# Retiring old Elasticsearch indices

**URL:** <https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691>\
**Category:** Elasticsearch\
**Created:** [January 5, 2017, 2:57pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691 "2017-01-05T14:57:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rs\_ela](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@rs\_ela](https://discuss.elastic.co/u/rs_ela)\
**Post date:** [January 5, 2017, 2:57pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691/1 "2017-01-05T14:57:13Z")

</div>

Hi all

I'm curious about retiring old indices. As far as I know, by default Elasticsearch stores data forever. Question number one: is there any option to set in config files some period (four weeks, for example) after which data would get automatically deleted?

I also know indices can be deleted by using curl -xdelete, for example: curl -XDELETE localhost:9200/logstash-2016.11.\*. This is something I could cron. Question two: is deleting data in such way safe? What I mean is whether using it would not break other indices / some other stuff?

Many thanks for your help

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 5, 2017, 2:59pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691/2 "2017-01-05T14:59:06Z")

</div>

You can manage all of this with `cron` and [Curator](https://github.com/elastic/curator).

Deleting indices via the API is safe.

---

<div class="post-metadata">

**Author:** ![rs\_ela](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@rs\_ela](https://discuss.elastic.co/u/rs_ela)\
**Post date:** [January 5, 2017, 3:23pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691/3 "2017-01-05T15:23:03Z")

</div>

So, as I assume, there is no built-in ELK option to enable that sets data (indices) retention limit?

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 5, 2017, 3:35pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691/4 "2017-01-05T15:35:26Z")

</div>

That's right, that's what Curator is built for.

---

<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:** [January 5, 2017, 3:35pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691/5 "2017-01-05T15:35:39Z")

</div>

That is correct. You can read more about Curator at [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html)

---

<div class="post-metadata">

**Author:** ![rs\_ela](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@rs\_ela](https://discuss.elastic.co/u/rs_ela)\
**Post date:** [January 5, 2017, 3:53pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691/6 "2017-01-05T15:53:52Z")

</div>

Right. I will look into that. Thanks, guys!

---

<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:** [February 2, 2017, 3:54pm UTC](https://discuss.elastic.co/t/retiring-old-elasticsearch-indices/70691/7 "2017-02-02T15:54:00Z")

</div>

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