Clusters of version 7.6.2 or later support index status management. ISM is a plugin that allows you to automate periodic and administrative operations based on changes on the index age, index size, or number of documents. When using the ISM plug-in, you can define policies that automatically handle index rollovers or deletions based on your needs.
The following procedure uses Elasticsearch 7.6.2 as an example. The Kibana UI varies depending on the Kibana version, but their operations are similar.
You can attach a policy to one or more indexes and add the policy ID to an index template. When you create indexes using that index template pattern, the policy will be attached to all created indexes.
On the Dev Tools page of Kibana, run the following command to associate a policy ID with an index template:
PUT _template/<template_name> { "index_patterns": ["index_name-*"], "settings": { "opendistro.index_state_management.policy_id": "policy_id" } }
For details about how to create an index template, see Index Template.
After you attach a policy to an index, ISM creates a job that runs every 5 minutes by default, to execute the policy, check conditions, and convert the index to different statuses.
For details, see Index State Management.