# Deleting daily indices

**URL:** https://discuss.elastic.co/t/deleting-daily-indices/162514
**Category:** Elasticsearch
**Created:** [December 31, 2018, 12:21pm UTC](https://discuss.elastic.co/t/deleting-daily-indices/162514 "2018-12-31T12:21:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![amitavmohanty01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amitavmohanty01/32/58017_2.png) [@amitavmohanty01](https://discuss.elastic.co/u/amitavmohanty01)
#### Post date: [December 31, 2018, 12:21pm UTC](https://discuss.elastic.co/t/deleting-daily-indices/162514/1 "2018-12-31T12:21:59Z")

</div>

I am having daily indices. I want to delete past indices beyond the last seven days. I read about [date maths in index names](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html) but I dont find a direct way of doing that in a single query.

My current strategy is as follows:

1. get all indices using \_cat/indices API
2. figure out old indices
3. call DELETE iteratively on those indices

Please let me know if there is a better way to do it.

I also looked at [Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/about.html) but it is no more supported. Are those functionalities incorporated in some other tool?

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [December 31, 2018, 12:37pm UTC](https://discuss.elastic.co/t/deleting-daily-indices/162514/2 "2018-12-31T12:37:59Z")

</div>

I think [Index Lifecycle Management](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/index-lifecycle-management.html) is the feature for you. It is not yet released, but is expected to appear in the next minor release (6.6).

---

<div class="post-metadata">

### Author: ![amitavmohanty01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amitavmohanty01/32/58017_2.png) [@amitavmohanty01](https://discuss.elastic.co/u/amitavmohanty01)
#### Post date: [December 31, 2018, 12:47pm UTC](https://discuss.elastic.co/t/deleting-daily-indices/162514/3 "2018-12-31T12:47:12Z")

</div>

Great. I was thinking if it is not there I can add a feature request for it.

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [December 31, 2018, 4:41pm UTC](https://discuss.elastic.co/t/deleting-daily-indices/162514/4 "2018-12-31T16:41:06Z")

</div>

Who told you that Curator was no longer supported? It works quite well for every minor release of Elasticsearch 5.x and 6.x

---

<div class="post-metadata">

### Author: ![amitavmohanty01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amitavmohanty01/32/58017_2.png) [@amitavmohanty01](https://discuss.elastic.co/u/amitavmohanty01)
#### Post date: [December 31, 2018, 5:08pm UTC](https://discuss.elastic.co/t/deleting-daily-indices/162514/5 "2018-12-31T17:08:15Z")

</div>

Ah, my bad. Just checked the [supported versions](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/version-compatibility.html) and it says Curator version 5.x will work with ES 6.x. Thank you for clarifying.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 28, 2019, 5:08pm UTC](https://discuss.elastic.co/t/deleting-daily-indices/162514/6 "2019-01-28T17:08:21Z")

</div>

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