Data stream stats API

Retrieves statistics for one or more data streams.

  1. GET /_data_stream/my-data-stream/_stats

Request

GET /_data_stream/<data-stream>

Path parameters

<data-stream>

(Optional, string) Comma-separated list of data streams used to limit the request. Wildcard expressions (*) are supported.

To target all data streams in a cluster, omit this parameter or use *.

Query parameters

human

(Optional, boolean) If true, the response includes statistics in human-readable byte values. Defaults to false.

Response body

_shards

(object) Contains information about shards that attempted to execute the request.

Properties of _shards

  • total

    (integer) Total number of shards that attempted to execute the request.

    successful

    (integer) Number of shards that successfully executed the request.

    failed

    (integer) Number of shards that failed to execute the request.

data_stream_count

(integer) Total number of selected data streams.

backing_indices

(integer) Total number of backing indices for the selected data streams.

total_store_sizes

(byte value) Total size of all shards for the selected data streams. This property is included only if the human query parameter is true.

total_store_size_bytes

(integer) Total size, in bytes, of all shards for the selected data streams.

data_streams

(array of objects) Contains statistics for the selected data streams.

Properties of objects in data_streams

  • data_stream

    (string) Name of the data stream.

    backing_indices

    (integer) Current number of backing indices for the data stream.

    store_size

    (byte value) Total size of all shards for the data stream’s backing indices. This parameter is only returned if the human query parameter is true.

    store_size_bytes

    (integer) Total size, in bytes, of all shards for the data stream’s backing indices.

    maximum_timestamp

    (integer) The data stream’s highest @timestamp value, converted to milliseconds since the Unix epoch.

    This timestamp is provided as a best effort. The data stream may contain @timestamp values higher than this if one or more of the following conditions are met:

    • The stream contains closed backing indices.
    • Backing indices with a lower generation contain higher @timestamp values.

Examples

  1. GET /_data_stream/my-data-stream*/_stats?human=true

The API returns the following response.

  1. {
  2. "_shards": {
  3. "total": 10,
  4. "successful": 5,
  5. "failed": 0
  6. },
  7. "data_stream_count": 2,
  8. "backing_indices": 5,
  9. "total_store_size": "7kb",
  10. "total_store_size_bytes": 7268,
  11. "data_streams": [
  12. {
  13. "data_stream": "my-data-stream",
  14. "backing_indices": 3,
  15. "store_size": "3.7kb",
  16. "store_size_bytes": 3772,
  17. "maximum_timestamp": 1607512028000
  18. },
  19. {
  20. "data_stream": "my-data-stream-two",
  21. "backing_indices": 2,
  22. "store_size": "3.4kb",
  23. "store_size_bytes": 3496,
  24. "maximum_timestamp": 1607425567000
  25. }
  26. ]
  27. }