Update data stream mappings

  • PUT /_data_stream/{name}/_mappings
Auth

This API can be used to override mappings on specific data streams. These overrides will take precedence over what is specified in the template that the data stream matches. The mapping change is only applied to new write indices that are created during rollover after this API is called. No indices are changed by this API.

Required privileges

Index privileges manage

Path parameters

name union string | string[] required

A comma-separated list of data streams or data stream patterns.

Query parameters

dry_run boolean · default: false

If true, the request does not actually change the mappings on any data streams. Instead, it simulates changing the settings and reports back to the user what would have happened had these settings actually been applied.

master_timeout string · 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.

timeout string · default: 30s

The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

Request body

date_detection boolean
dynamic enum
Values: strict runtime true false
dynamic_date_formats string[]
dynamic_templates string to object[]
_meta object
numeric_detection boolean
properties map string to oneOf
runtime map string to object
enabled boolean
subobjects enum
Values: true false

Response

application/json
data_streams object[] required
name string required

The data stream name.

applied_to_data_stream boolean required

If the mappings were successfully applied to the data stream (or would have been, if running in dry_run mode), it is true. If an error occurred, it is false.

error string

A message explaining why the mappings could not be applied to the data stream.

effective_mappings object

The mappings that are effective on this data stream, taking into account the mappings from the matching index template and the mappings specific to this data stream.

Same fields as mappings in data_streams