2020-05-15 10:37:45 -04:00
|
|
|
[[indices-get-data-stream]]
|
|
|
|
=== Get data stream API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Get data stream</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
|
|
|
Returns information about one or more data streams.
|
|
|
|
|
|
|
|
////
|
|
|
|
[source,console]
|
|
|
|
-----------------------------------
|
2020-05-28 09:08:25 -04:00
|
|
|
PUT _index_template/template
|
2020-05-15 10:37:45 -04:00
|
|
|
{
|
2020-05-28 09:08:25 -04:00
|
|
|
"index_patterns": ["my-data-stream*"],
|
|
|
|
"data_stream": {
|
|
|
|
"timestamp_field": "@timestamp"
|
|
|
|
}
|
2020-05-15 10:37:45 -04:00
|
|
|
}
|
2020-05-28 09:08:25 -04:00
|
|
|
|
|
|
|
PUT /_data_stream/my-data-stream
|
2020-05-15 10:37:45 -04:00
|
|
|
-----------------------------------
|
|
|
|
// TESTSETUP
|
|
|
|
////
|
|
|
|
|
|
|
|
////
|
|
|
|
[source,console]
|
|
|
|
-----------------------------------
|
|
|
|
DELETE /_data_stream/my-data-stream
|
2020-05-28 09:08:25 -04:00
|
|
|
DELETE /_index_template/template
|
2020-05-15 10:37:45 -04:00
|
|
|
-----------------------------------
|
|
|
|
// TEARDOWN
|
|
|
|
////
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
2020-05-15 11:27:53 -04:00
|
|
|
GET _data_stream/my-data-stream
|
2020-05-15 10:37:45 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[skip_shard_failures]
|
|
|
|
|
|
|
|
[[get-data-stream-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
2020-05-15 11:27:53 -04:00
|
|
|
`GET _data_stream/<data-stream>`
|
2020-05-15 10:37:45 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[get-data-stream-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<data-stream>`::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
(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]
|
|
|
|
--------------------------------------------------
|
2020-05-15 11:27:53 -04:00
|
|
|
GET _data_stream/my-data-stream*
|
2020-05-15 10:37:45 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// 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>
|
|
|
|
{
|
2020-06-09 10:31:34 -04:00
|
|
|
"index_name" : ".ds-my-data-stream-000001",
|
2020-05-15 10:37:45 -04:00
|
|
|
"index_uuid" : "DXAE-xcCQTKF93bMm9iawA"
|
|
|
|
},
|
|
|
|
{
|
2020-06-09 10:31:34 -04:00
|
|
|
"index_name" : ".ds-my-data-stream-000002",
|
2020-05-15 10:37:45 -04:00
|
|
|
"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
|
|
|
|
|