# How retain certain index for more time than the other?

**URL:** <https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469>\
**Category:** Elasticsearch\
**Created:** [August 18, 2020, 4:33pm UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469 "2020-08-18T16:33:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![srbhklkrn](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@srbhklkrn](https://discuss.elastic.co/u/srbhklkrn)\
**Post date:** [August 18, 2020, 4:33pm UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/1 "2020-08-18T16:33:27Z")

</div>

I'm on Elasticsearch 6.4, I have 4 indexes out of which for 2 I need to set the retention period to be 60 days, how do I set that?

---

<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:** [August 18, 2020, 8:57pm UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/2 "2020-08-18T20:57:23Z")

</div>

Have you looked at [ILM](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html)?

---

<div class="post-metadata">

**Author:** ![srbhklkrn](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@srbhklkrn](https://discuss.elastic.co/u/srbhklkrn)\
**Post date:** [August 18, 2020, 9:25pm UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/3 "2020-08-18T21:25:43Z")

</div>

Yes, but its not available in 6.4 I guess not seen anything related to ILM in 6.4 docs. It got introduced in 6.8.

---

<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:** [August 18, 2020, 9:26pm UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/4 "2020-08-18T21:26:35Z")

</div>

Ah ok, can you upgrade?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 18, 2020, 9:30pm UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/5 "2020-08-18T21:30:40Z")

</div>

Are you using time-based indices or will you need to delete specific documents from within the indices?

---

<div class="post-metadata">

**Author:** ![srbhklkrn](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@srbhklkrn](https://discuss.elastic.co/u/srbhklkrn)\
**Post date:** [August 19, 2020, 1:20am UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/6 "2020-08-19T01:20:18Z")

</div>

I’m planning to upgrade but in the upgrade process I might need to delete or reindex all my indexes and I’m trying to avoid that by saving some indexes.

---

<div class="post-metadata">

**Author:** ![srbhklkrn](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@srbhklkrn](https://discuss.elastic.co/u/srbhklkrn)\
**Post date:** [August 19, 2020, 1:22am UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/7 "2020-08-19T01:22:55Z")

</div>

I’m using time based indexes, everyday it generates new index, basically pattern is `<index_name>-mm-dd-yyyy `

---

<div class="post-metadata">

**Author:** ![sunxi](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@sunxi](https://discuss.elastic.co/u/sunxi)\
**Post date:** [August 19, 2020, 3:22am UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/8 "2020-08-19T03:22:44Z")

</div>

> [@srbhklkrn](#):
>
> I'm on Elasticsearch 6.4, I have 4 indexes out of which for 2 I need to set the retention period to be 60 days, how do I set that

We create index everyday, the basic pattern is like: index\_name-yyyy-mm-dd.We write some shell scripts to implement the index lifecycle management, for example:create snapshot for indices everyday 、periodically delete index that have been backed up successfully.Maybe you can try !

---

<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:** [September 16, 2020, 3:22am UTC](https://discuss.elastic.co/t/how-retain-certain-index-for-more-time-than-the-other/245469/9 "2020-09-16T03:22:56Z")

</div>

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