# How to delete elasticsearch data which is older than 90 days from a static Index

**URL:** <https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591>\
**Category:** Elasticsearch\
**Created:** [February 24, 2016, 1:39pm UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591 "2016-02-24T13:39:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 24, 2016, 1:39pm UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/1 "2016-02-24T13:39:36Z")

</div>

Hi Experts,

I have one static Index(I mean I do not create index every day) , but data is keep on coming on daily basis . My requirement is to delete old data from this single index to make more disk space .

I found **ES Curator** is the solution , but I am afraid of using it , as document says it is only best fit to delete an indices older than mentioned time frame, so as per my understanding if I use curator it will delete my overall index rather just old data sorry if I misunderstood it , please correct me.

So if not curator what other option I have ?

Thanks  
Vikas

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 24, 2016, 1:43pm UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/2 "2016-02-24T13:43:55Z")

</div>

You can use the delete by query API (which is provided via a plugin as of ES 2.0), but you really really shouldn't. For time-series data the best option is to use time-series indexes.

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 24, 2016, 2:03pm UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/3 "2016-02-24T14:03:06Z")

</div>

So Curator is not an option for me ? actually i am on ES 1.7.1.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 24, 2016, 2:34pm UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/4 "2016-02-24T14:34:40Z")

</div>

I don't think Curator supports the delete by query API. If it does you should be okay.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 25, 2016, 5:43am UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/5 "2016-02-25T05:43:24Z")

</div>

Curator does not support DQB.

You are much better off moving to time based indices.

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 25, 2016, 9:10am UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/6 "2016-02-25T09:10:28Z")

</div>

Hmmmm, what about TTL ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 25, 2016, 1:30pm UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/7 "2016-02-25T13:30:56Z")

</div>

Possible but also a bad idea (and deprecated since ES 2.0). Deleting documents from big shards (regardless of whether via TTL or other method of deleting documents) is expensive.

---

<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:** [July 5, 2017, 11:13pm UTC](https://discuss.elastic.co/t/how-to-delete-elasticsearch-data-which-is-older-than-90-days-from-a-static-index/42591/8 "2017-07-05T23:13:44Z")

</div>


