Get data stream lifecycle stats
Gets stats about the execution of data stream lifecycle.
Prerequisites
- If the Elasticsearch security features are enabled, you must have the
monitorormanagecluster privilege to use this API.
Request
GET _lifecycle/stats
Description
Gets stats about the execution of the data stream lifecycle. The data stream level stats include only stats about data streams managed by the data stream lifecycle.
Response body
-
last_run_duration_in_millis - (Optional, long) The duration of the last data stream lifecycle execution.
-
time_between_starts_in_millis - (Optional, long) The time passed between the start of the last two data stream lifecycle executions. This should amount approximately to
data_streams.lifecycle.poll_interval. -
data_stream_count - (integer) The count of data streams currently being managed by the data stream lifecycle.
-
data_streams -
(array of objects) Contains information about the retrieved data stream lifecycles.
Properties of objects in
data_streams-
name - (string) The name of the data stream.
-
backing_indices_in_total - (integer) The count of the backing indices of this data stream that are managed by the data stream lifecycle.
-
backing_indices_in_error - (integer) The count of the backing indices of this data stream that are managed by the data stream lifecycle and have encountered an error.
-
Examples
Let’s retrieve the data stream lifecycle stats of a cluster that has already executed the lifecycle more than once:
resp = client.indices.get_data_lifecycle_stats(
human=True,
pretty=True,
)
print(resp) GET _lifecycle/stats?human&pretty
The response will look like the following:
{
"last_run_duration_in_millis": 2,
"last_run_duration": "2ms",
"time_between_starts_in_millis": 9998,
"time_between_starts": "9.99s",
"data_streams_count": 2,
"data_streams": [
{
"name": "my-data-stream",
"backing_indices_in_total": 2,
"backing_indices_in_error": 0
},
{
"name": "my-other-stream",
"backing_indices_in_total": 2,
"backing_indices_in_error": 1
}
]
}
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-get-lifecycle-stats.html