---
type: api
title: Get data stream mappings
description: Get mapping information for one or more data streams.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings
products:
  - Elasticsearch
---

# Get data stream mappings

Availability: 9.1+

## Paths

- `GET` `/_data_stream/{name}/_mappings`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#bearerauth)

#### Path Parameters

- `name` (union IndexName | [] IndexName)
  A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`).

## Description

Get mapping information for one or more data streams.

## Required authorization

* Index privileges: `view_index_metadata`

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  The period to wait for a connection to the master node. If no response is
received before the timeout expires, the request fails and returns an
error.

## Response

`application/json`

- `data_streams` ([] DataStreamMappings)
  - `name` (string)
    The name of the data stream.
  - `mappings` ({} TypeMapping)
    The settings specific to this data stream
    - `all_field` ({} AllField)
      - `analyzer` (string)
      - `enabled` (boolean)
      - `omit_norms` (boolean)
      - `search_analyzer` (string)
      - `similarity` (string)
      - `store` (boolean)
      - `store_term_vector_offsets` (boolean)
      - `store_term_vector_payloads` (boolean)
      - `store_term_vector_positions` (boolean)
      - `store_term_vectors` (boolean)
    - `date_detection` (boolean)
    - `dynamic` (enum DynamicMapping)
      Values: `strict`, `runtime`, `true`, `false`
    - `dynamic_date_formats` ([] string)
    - `dynamic_templates` ([] string to DynamicTemplate)
    - `_field_names` ({} FieldNamesField)
      - `enabled` (boolean)
    - `index_field` ({} IndexField)
      - `enabled` (boolean)
    - `_meta` (Metadata)
    - `numeric_detection` (boolean)
    - `properties` (map string to Property)
    - `_routing` ({} RoutingField)
      - `required` (boolean)
    - `_size` ({} SizeField)
      - `enabled` (boolean)
    - `_source` ({} SourceField)
      - `enabled` (boolean)
      - `excludes` ([] string)
      - `includes` ([] string)
      - `mode` (enum SourceFieldMode)
        

Supported values include:
  - `disabled`
  - `stored`
  - `columnar_stored`
  - `synthetic`: Instead of storing source documents on disk exactly as you send them,
 Elasticsearch can reconstruct source content on the fly upon retrieval.
        Values: `disabled`, `stored`, `columnar_stored`, `synthetic`
    - `runtime` (map string to RuntimeField)
      Map values ({} RuntimeField)
      - `fields` (map string to CompositeSubField)
        For type `composite`
        Map values ({} CompositeSubField)
        - `type` (enum RuntimeFieldType)
          Values: `boolean`, `composite`, `date`, `double`, `geo_point`, `geo_shape`, `ip`, `keyword`, `long`, `lookup`
      - `fetch_fields` ([] RuntimeFieldFetchFields)
        For type `lookup`
        - `field` (string Field)
        - `format` (string)
      - `format` (string)
        A custom format for `date` type runtime fields.
      - `input_field` (string Field)
        For type `lookup`
      - `target_field` (string Field)
        For type `lookup`
      - `target_index` (string IndexName)
        For type `lookup`
      - `script` (string Script)
        Painless script executed at query time.
      - `on_script_error` (enum OnScriptError)
        Values: `fail`, `continue`
      - `type` (enum RuntimeFieldType)
        Field type, which can be: `boolean`, `composite`, `date`, `double`, `geo_point`, `ip`,`keyword`, `long`, or `lookup`.
        Values: `boolean`, `composite`, `date`, `double`, `geo_point`, `geo_shape`, `ip`, `keyword`, `long`, `lookup`
    - `enabled` (boolean)
    - `subobjects` (enum Subobjects)
      Values: `true`, `false`
    - `_data_stream_timestamp` ({} DataStreamTimestamp)
      - `enabled` (boolean)
  - `effective_mappings` ({} TypeMapping)
    The settings specific to this data stream merged with the settings from its template. These `effective_settings`
are the settings that will be used when a new index is created for this data stream.
    Same fields as `mappings` in `data_streams`
## Code Examples

#### Console

```console
GET /_data_stream/my-data-stream/_mappings
```

#### JavaScript

```javascript
const response = await client.indices.getDataStreamMappings({
  name: "my-data-stream",
});
```

#### Python

```python
resp = client.indices.get_data_stream_mappings(
    name="my-data-stream",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_data_stream/my-data-stream/_mappings" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.indices().getDataStreamMappings(g -> g
    .name("my-data-stream")
);
```

#### C#

```c#
var response = await client.Indices.GetDataStreamMappingsAsync(name: new[] { "my-data-stream" });
```

#### PHP

```php
$resp = $client->indices()->getDataStreamMappings([
    "name" => "my-data-stream",
]);
```

#### Ruby

```ruby
response = client.indices.get_data_stream_mappings(
  name: "my-data-stream"
)
```

## Response Examples

#### Get data stream settings on a data stream

This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The `effective_settings` field shows additional settings that are pulled from its template.

```json
{
  "data_streams": [
    {
      "name": "my-data-stream",
      "mappings": {
        "properties": {
          "field1": {
            "type": "ip"
          },
          "field3": {
            "type": "text"
          }
        }
      },
      "effective_mappings": {
        "properties": {
          "field1": {
            "type": "ip"
          },
          "field2": {
            "type": "text"
          },
          "field3": {
            "type": "text"
          }
        }
      }
    }
  ]
}
```

