Get information about an index or data stream's current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution.
Required authorization
- Index privileges:
view_index_metadata
GET
/{index}/_lifecycle/explain
Console
GET .ds-metrics-2023.03.22-000001/_lifecycle/explain
resp = client.indices.explain_data_lifecycle(
index=".ds-metrics-2023.03.22-000001",
)
const response = await client.indices.explainDataLifecycle({
index: ".ds-metrics-2023.03.22-000001",
});
response = client.indices.explain_data_lifecycle(
index: ".ds-metrics-2023.03.22-000001"
)
$resp = $client->indices()->explainDataLifecycle([
"index" => ".ds-metrics-2023.03.22-000001",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/.ds-metrics-2023.03.22-000001/_lifecycle/explain"
var response = await client.Indices.ExplainDataLifecycleAsync(indices: new[] { ".ds-metrics-2023.03.22-000001" });
client.indices().explainDataLifecycle(e -> e
.index(".ds-metrics-2023.03.22-000001")
);
Response examples (200)
The API reports any errors related to the lifecycle execution for the target index.
{
"indices": {
".ds-my-data-stream-test-2026.10.17-000001": {
"index": ".ds-my-data-stream-test-2026.10.17-000001",
"managed_by_lifecycle": true,
"index_creation_date_millis": 1792195511314,
"time_since_index_creation": "3.07d",
"rollover_date_millis": 1792440980120,
"time_since_rollover": "5.51h",
"generation_time": "5.51h",
"lifecycle": {
"enabled": true,
"data_retention": "30d",
"effective_retention": "30d",
"retention_determined_by": "data_stream_configuration"
},
"error": {
"first_occurrence_millis": 1792441580075,
"message": """{"type":"exception","reason":"Force merge request only had 1 successful shards out of a total of 2"}""",
"last_recorded_millis": 1792460779960,
"retry_count": 52
}
},
".ds-my-data-stream-test-2026.10.19-000002": {
"index": ".ds-my-data-stream-test-2026.10.19-000002",
"managed_by_lifecycle": true,
"index_creation_date_millis": 1792440980129,
"time_since_index_creation": "5.51h",
"lifecycle": {
"enabled": true,
"data_retention": "30d",
"effective_retention": "30d",
"retention_determined_by": "data_stream_configuration"
}
}
}
}