# Delete old indices automatically?

**URL:** <https://discuss.elastic.co/t/delete-old-indices-automatically/90350>\
**Category:** Elasticsearch\
**Created:** [June 21, 2017, 7:19pm UTC](https://discuss.elastic.co/t/delete-old-indices-automatically/90350 "2017-06-21T19:19:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![munotshubham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/munotshubham/32/22663_2.png) [@munotshubham](https://discuss.elastic.co/u/munotshubham)\
**Post date:** [June 21, 2017, 7:19pm UTC](https://discuss.elastic.co/t/delete-old-indices-automatically/90350/1 "2017-06-21T19:19:01Z")

</div>

Hi,

So I have created an ELK stack for passing IIS logs and it is generating around 3GB a day and it is storing in an index a day. Eg: filebeat-2017.06.21

I want to delete old index so that ElasticSearch doesn't crash. How should I do?  
Do I have to do this manually or is there a way?

I saw something called "Curator"? Should use that?

---

<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:** [June 21, 2017, 10:46pm UTC](https://discuss.elastic.co/t/delete-old-indices-automatically/90350/2 "2017-06-21T22:46:50Z")

</div>

Yes. [Read the documentation for more information.](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.1/index.html)

---

<div class="post-metadata">

**Author:** ![munotshubham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/munotshubham/32/22663_2.png) [@munotshubham](https://discuss.elastic.co/u/munotshubham)\
**Post date:** [June 22, 2017, 12:57pm UTC](https://discuss.elastic.co/t/delete-old-indices-automatically/90350/3 "2017-06-22T12:57:35Z")

</div>

Hey thanks. I used their python library, wrote a script and added a job on crontab.  
Thanks anyway.

---

<div class="post-metadata">

**Author:** ![munotshubham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/munotshubham/32/22663_2.png) [@munotshubham](https://discuss.elastic.co/u/munotshubham)\
**Post date:** [June 28, 2017, 6:39pm UTC](https://discuss.elastic.co/t/delete-old-indices-automatically/90350/4 "2017-06-28T18:39:05Z")

</div>

Hey,

It is working fine, but after deleting the old indices, it regenerates after a minute or two. What should i do?

---

<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:** [June 28, 2017, 8:14pm UTC](https://discuss.elastic.co/t/delete-old-indices-automatically/90350/5 "2017-06-28T20:14:27Z")

</div>

That can only happen if data is still being written to those indices. I'd investigate that.

---

<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 26, 2017, 8:14pm UTC](https://discuss.elastic.co/t/delete-old-indices-automatically/90350/6 "2017-07-26T20:14:29Z")

</div>

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