[[indices-get-data-stream]]
=== Get data stream API
++++
Get data stream
++++
Retrieves information about one or more <>.
See <>.
////
[source,console]
----
PUT _index_template/template
{
"index_patterns": ["my-data-stream*"],
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
},
"data_stream": {
"timestamp_field": "@timestamp"
}
}
PUT /_data_stream/my-data-stream
----
// TESTSETUP
////
////
[source,console]
----
DELETE /_data_stream/my-data-stream
DELETE /_index_template/template
----
// TEARDOWN
////
[source,console]
----
GET /_data_stream/my-data-stream
----
// TEST[skip_shard_failures]
[[get-data-stream-api-request]]
==== {api-request-title}
`GET /_data_stream/`
[[get-data-stream-api-path-params]]
==== {api-path-parms-title}
``::
(Required, string)
Name of the data stream to retrieve.
Wildcard (`*`) expressions are supported.
[role="child_attributes"]
[[get-data-stream-api-response-body]]
==== {api-response-body-title}
`name`::
(string)
Name of the data stream.
`timestamp_field`::
(string)
Name of the data stream's timestamp field. This 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
<>.
+
.Properties of `indices` objects
[%collapsible%open]
====
`index_name`::
(string)
Name of the backing index. For naming conventions, see
<>.
`index_uuid`::
(string)
Universally unique identifier (UUID) for the index.
====
`generation`::
(integer)
Current <> for the data stream. This number
acts as a cumulative count of the stream's backing indices, including
deleted indices.
[[get-data-stream-api-example]]
==== {api-examples-title}
[source,console]
----
GET _data_stream/my-data-stream*
----
// TEST[continued]
// TEST[skip_shard_failures]
The API returns the following response:
[source,console-result]
----
[
{
"name" : "my-data-stream", <1>
"timestamp_field" : "@timestamp", <2>
"indices" : [ <3>
{
"index_name" : ".ds-my-data-stream-000001",
"index_uuid" : "DXAE-xcCQTKF93bMm9iawA"
},
{
"index_name" : ".ds-my-data-stream-000002",
"index_uuid" : "Wzxq0VhsQKyPxHhaK3WYAg"
}
],
"generation" : 2 <4>
}
]
----
// TESTRESPONSE[skip:unable to assert responses with top level array]
<1> Name of the data stream
<2> The name of the timestamp field for the data stream
<3> List of backing indices
<4> Current generation for the data stream