What is Index Lifecycle Management (ILM) in Elasticsearch?

Answer

Index Lifecycle Management (ILM) automates the management of time-series indices through a configurable policy with up to five phases: Hot (active writing and querying — can trigger rollover when the index exceeds a size or document count threshold), Warm (no longer written to — shard allocation moved to warm tier, force-merged to reduce segment count, replicas may be reduced), Cold (infrequently accessed — moved to cold tier, possibly made searchable-only), Frozen (data mounted from snapshot repository, minimal memory footprint, slow query times), and Delete (the index is permanently removed). ILM policies are attached to index templates, so every new index created by that template automatically follows the lifecycle. This is essential for managing growing log and metrics data without manual intervention.