[[indices-get-data-stream]]
=== Get data stream API
++++
Get data stream
++++
Returns information about one or more data streams.
////
[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 or wildcard expression of the data stream(s) to
retrieve.
--
[[get-data-stream-api-example]]
==== {api-examples-title}
[[get-data-stream-basic-example]]
===== Basic example
[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