Get Data Stream API
Introduced 1.0
The Get Data Stream API returns information about one or more data streams, including their backing indexes, generation, and status.
Endpoints
GET /_data_stream
GET /_data_stream/{name}
Path parameters
The following table lists the available path parameters. All path parameters are optional.
| Parameter | Data type | Description |
|---|---|---|
name | List or String | A comma-separated list of data stream names used to limit the request. Wildcard (*) expressions are supported. If omitted, all data streams are returned. |
Query parameters
The following table lists the available query parameters. All query parameters are optional.
| Parameter | Data type | Description | Default |
|---|---|---|---|
error_trace | Boolean | Whether to include the stack trace of returned errors. | false |
filter_path | List or String | Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with -. | N/A |
human | Boolean | Whether to return human-readable values for statistics. | false |
pretty | Boolean | Whether to pretty format the returned JSON response. | false |
source | String | The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. | N/A |
Example request
The following example request returns information about all data streams in the cluster:
GET /_data_streamresponse = client.indices.get_data_stream()To return information about a specific data stream, provide its name as the name path parameter:
GET /_data_stream/logs-appresponse = client.indices.get_data_stream(
name = "logs-app"
)Example response
{
"data_streams": [
{
"name": "logs-app",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-logs-app-000001",
"index_uuid": "23dD0HE5Sg2kSLLAP_YtNA"
}
],
"generation": 1,
"status": "YELLOW",
"template": "template-logs-app"
}
]
}
Response body fields
| Field | Data type | Description |
|---|---|---|
data_streams | Array | A list of objects, one for each data stream. For object fields, see The data stream objects. |
The data stream objects
Each data stream object contains the following fields.
| Field | Data type | Description |
|---|---|---|
name | String | The name of the data stream. |
timestamp_field | Object | The timestamp field configuration for the data stream. |
timestamp_field.name | String | The name of the timestamp field, usually @timestamp. |
indices | Array | A list of the data stream’s backing indexes. The last item in the array is the current write index. For object fields, see The backing index objects. |
generation | Integer | The current generation of the data stream. This number increases by one with each rollover. |
status | String | The health status of the data stream, based on the health of its backing indexes. Valid values are GREEN, YELLOW, and RED. |
template | String | The name of the index template used to create the data stream. |
hidden | Boolean | Whether the data stream is hidden. |
system | Boolean | Whether the data stream is managed internally by OpenSearch and cannot be modified through normal user interaction. |
ilm_policy | String | The name of the associated Index State Management (ISM) policy, if one is configured. |
allow_custom_routing | Boolean | Whether the data stream allows custom routing on write requests. |
_meta | Object | Custom metadata attached to the data stream. |
The backing index objects
Each backing index object contains the following fields.
| Field | Data type | Description |
|---|---|---|
index_name | String | The name of the backing index. |
index_uuid | String | The UUID of the backing index. |
Required permissions
If you use the Security plugin, make sure you have the appropriate permissions: indices:admin/data_stream/get.