Get data stream API
Retrieves information about one or more data streams. See Get information about a data stream.
GET /_data_stream/my-data-stream
Request
GET /_data_stream/<data-stream>
Path parameters
<data-stream>
(Optional, string) Comma-separated list of data stream names used to limit the request. Wildcard (*
) expressions are supported. If omitted, all data streams will be returned.
Response body
data_streams
(array of objects) Contains information about retrieved data streams.
Properties of objects in data_streams
name
(string) Name of the data stream.
timestamp_field
(object) Contains information about the data stream’s
@timestamp
field.Properties of
timestamp_field
name
(string) Name of the data stream’s timestamp field, which must be
@timestamp
. The@timestamp
field must be included in every document indexed to the data stream.
`indices`
(array of objects) Array of objects containing information about the data stream’s backing indices.
The last item in this array contains information about the stream’s current [write index]($4618071bf1c879cb.md#data-stream-write-index "Write index").
Properties of `indices` objects
- `index_name`
(string) Name of the backing index. For naming conventions, see [Generation]($4618071bf1c879cb.md#data-streams-generation "Generation").
`index_uuid`
(string) Universally unique identifier (UUID) for the index.
`generation`
(integer) Current [generation]($4618071bf1c879cb.md#data-streams-generation "Generation") for the data stream. This number acts as a cumulative count of the stream’s backing indices, including deleted indices.
`status`
(string) [Health status]($f5a22e73b1d30cf1.md "Cluster health API") of the data stream.
This health status is based on the state of the primary and replica shards of the stream’s backing indices.
Values for `status`
- `green`
All shards are assigned.
`yellow`
All primary shards are assigned, but one or more replica shards are unassigned.
`red`
One or more primary shards are unassigned, so some data is unavailable.
`template`
(string) Name of the index template used to create the data stream’s backing indices.
The template’s index pattern must match the name of this data stream. See [Create an index template for a data stream]($beb5bf4d08d7f40c.md#create-a-data-stream-template "Create an index template for a data stream").
`ilm_policy`
(string) Name of the current ILM lifecycle policy in the stream’s matching index template. This lifecycle policy is set in the `index.lifecycle.name` setting.
If the template does not include a lifecycle policy, this property is not included in the response.
A data stream’s backing indices may be assigned different lifecycle policies. To retrieve the lifecycle policy for individual backing indices, use the [get index settings API]($d50b7a3f612cc1d4.md "Get index settings API").
Examples
GET _data_stream/my-data-stream*
The API returns the following response:
{
"data_streams": [
{
"name": "my-data-stream",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-my-data-stream-000001",
"index_uuid": "xCEhwsp8Tey0-FLNFYVwSg"
},
{
"index_name": ".ds-my-data-stream-000002",
"index_uuid": "PA_JquKGSiKcAKBA8DJ5gw"
}
],
"generation": 2,
"status": "GREEN",
"template": "my-index-template",
"ilm_policy": "my-lifecycle-policy"
},
{
"name": "my-data-stream_two",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-my-data-stream_two-000001",
"index_uuid": "3liBu2SYS5axasRt6fUIpA"
}
],
"generation": 1,
"status": "YELLOW",
"template": "my-index-template",
"ilm_policy": "my-lifecycle-policy"
}
]
}