# Query about lifecycle management

**URL:** https://discuss.elastic.co/t/query-about-lifecycle-management/256292
**Category:** Elasticsearch
**Created:** [November 23, 2020, 1:14am UTC](https://discuss.elastic.co/t/query-about-lifecycle-management/256292 "2020-11-23T01:14:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Russell\_Fulton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russell_fulton/32/62888_2.png) [@Russell\_Fulton](https://discuss.elastic.co/u/Russell_Fulton)
#### Post date: [November 23, 2020, 1:14am UTC](https://discuss.elastic.co/t/query-about-lifecycle-management/256292/1 "2020-11-23T01:14:56Z")

</div>

I have a years worth of daily indexes that I am cleaning up by reindexing. Reading the "FM" I find that there appears to be a much better way to manage indexes other then blindly creating a new index each day (I was wondering why I was running out of shards!). So I am looking to adding lifecyle options to the index template.

My first instinct is to get the new data going into the revamped index stream and then reindex the old data into the new stream while cleaning it up and getting it all consistent, but I have doubts...

My question is "How does ES work out the age of an index for moving it between hot and warm/cold"?

Does it work on index create time or does it use the time field in the index?

I am adding some cold nodes to the cluster and I want all my "old" indexes stored there but if these indexes are newly created via a reindex will this work?

suggestions as how best to proceed solicited 🙂

Russell

---

<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: [November 23, 2020, 1:16am UTC](https://discuss.elastic.co/t/query-about-lifecycle-management/256292/2 "2020-11-23T01:16:41Z")

</div>

> [@Russell\_Fulton](#):
>
> index create time

This one.

You'd be better of moving new data to ILM, then just removing old data as it ages out.

---

<div class="post-metadata">

### Author: ![Russell\_Fulton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russell_fulton/32/62888_2.png) [@Russell\_Fulton](https://discuss.elastic.co/u/Russell_Fulton)
#### Post date: [November 23, 2020, 7:04pm UTC](https://discuss.elastic.co/t/query-about-lifecycle-management/256292/3 "2020-11-23T19:04:31Z")

</div>

Thanks Mark  
My question is how does ES determine the age of the index -- by its contents (which your answer implies) or by the creation time of the index?

My initial instinct was to do what you suggest but then I wondered if ES would think the indexes with old data were new because they were created yesterday

---

<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: [November 23, 2020, 7:23pm UTC](https://discuss.elastic.co/t/query-about-lifecycle-management/256292/4 "2020-11-23T19:23:47Z")

</div>

I believe Curator has an option to base age on the data the index holds, but this is as far as I know not possible with ILM. Age is therefore as far as I recall based on index creation date.

---

<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: [November 23, 2020, 9:48pm UTC](https://discuss.elastic.co/t/query-about-lifecycle-management/256292/5 "2020-11-23T21:48:41Z")

</div>

> [@Russell\_Fulton](#):
>
> My question is how does ES determine the age of the index -- by its contents (which your answer implies) or by the creation time of the index?

I am not sure how you read that given what I quoted and how I responded? But as it seems a little unclear - it uses _the index creation time_.

---

<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: [December 21, 2020, 9:48pm UTC](https://discuss.elastic.co/t/query-about-lifecycle-management/256292/6 "2020-12-21T21:48:59Z")

</div>

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