I have an index lifecycle policy set up which I want to delete indices after 30 days. In order to achieve this the policy has two phases:
- Hot Phase (with 'Delete data after this phase' selected)
- Delete Phase (indices moved here 30 days after creation)
The Elasticsearch request displayed in the UI to create this policy is as follows:
PUT _ilm/policy/bounce-logs-rollover-30-days
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"set_priority": {
"priority": 100
}
}
},
"delete": {
"min_age": "30d",
"actions": {
"wait_for_snapshot": {
"policy": "bounce-daily-snapshots"
},
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
}
}
As far as I can tell everything is set up correctly. The snapshot policy which is being waited upon is also executing successfully. However, when I search through my indices I am finding indices older than 30 days still existing and am having to manually delete them.
This index policy is attached to 5 index templates which is linked to ~400 indices. You can see an example of the index template attachment below:
Note: I don't want to perform any rollover to any other phases, just a straightforward deletion of indices after 30 days.