Keep active index while deleting old indices with ILM

We rebuild the same index regularly (multiple times per day) to keep our data up to date. This way we quickly generate a lot of old indices.

So we thought about removing them with a policy (ILM) which deletes old indices let's say 7 days after index creation.

This works fine but the only problem with it is that it could potentially delete the current (active) index. In a hypothetical scenario when the index rebuild would stop for 7 days it would delete the currently active index.

So my question is whether there is a way to keep the active index from being deleted. We have an alias on the current index. Is there a way to protect it from deletion and when switching to the new index we can switch the protection over to the newly created index?

No there's not, it'll run based on the policy irrespective of if it's being used.

Ok, thanks for your confirmation Mark.

Do you know of another way to implement/configure such behaviour (keep active index and only delete old ones) within Elasticsearch itself? Or do we have to implement it ourselves?

That'd be DIY.

That'd be DIY.

Alright. Thank you!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.