# Little bit confused on min\_age parameter in ilm

**URL:** <https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [March 8, 2022, 7:50am UTC](https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049 "2022-03-08T07:50:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokulnath112](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gokulnath112](https://discuss.elastic.co/u/gokulnath112)\
**Post date:** [March 8, 2022, 7:50am UTC](https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049/1 "2022-03-08T07:50:34Z")

</div>

Greetings...!  
Im currently using below ilm policy for my project. I just want to know the life span of an index. PUT \_ilm/policy/hot\_warm\_delete  
{  
"policy": {  
"phases": {  
"hot": {  
"min\_age": "0ms",  
"actions": {  
"rollover": {  
"max\_size": "50gb",  
"max\_age": "7d"  
},  
"set\_priority": {  
"priority": 50  
}  
}  
},  
"warm": {  
"min\_age": "7d",  
"actions": {  
"set\_priority": {  
"priority": 25  
}  
}  
},  
"delete": {  
"min\_age": "7d",  
"actions": {  
"delete": {  
"delete\_searchable\_snapshot": true  
}  
}  
}  
}  
}  
}

From my ILM policy, will my index get deleted after 7 days(as mentioned in delete phase) or 21 days(7 days in hot& 7 days in warm & 7 days in Delete).  
Kindly help me here.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 9, 2022, 7:11am UTC](https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049/2 "2022-03-09T07:11:37Z")

</div>

`min_ Age` usually refers to the time since the index was created，  
so your index will be deleted after 7 days

---

<div class="post-metadata">

**Author:** ![gokulnath112](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gokulnath112](https://discuss.elastic.co/u/gokulnath112)\
**Post date:** [March 9, 2022, 7:15am UTC](https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049/3 "2022-03-09T07:15:04Z")

</div>

Thanks a ton casterQ. That clarifies my doubt.

---

<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:** [April 6, 2022, 7:15am UTC](https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049/4 "2022-04-06T07:15:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![insuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/insuk/32/29396_2.png) [@insuk](https://discuss.elastic.co/u/insuk)\
**Post date:** [October 3, 2023, 3:14am UTC](https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049/5 "2023-10-03T03:14:16Z")

</div>

In this case, the hot phase has `rollover` action. So, it will be deleted 7 days after rollover. Check this reference: [Tutorial: Automate rollover with ILM | Elasticsearch Guide [8.10] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html#ilm-gs-create-policy)

**The `min_age` value is relative to the rollover time, not the index creation time.**

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 3, 2023, 4:12am UTC](https://discuss.elastic.co/t/little-bit-confused-on-min-age-parameter-in-ilm/299049/6 "2023-10-03T04:12:36Z")

</div>

@gokulnath112 @casterQ

Correction.

Actually since the policy above hot phase indicates `rollover` all subsequent `min_age`s calculations are from the rollover date not creation date.

See here

> **[Tutorial: Automate rollover with ILM | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html)**

> All subsequent `min_age`s are calculated from the rollover date

> For example, you might define a timeseries\_policy that has two phases:

> A hot phase that defines a rollover action to specify that an index rolls over when it reaches either a max\_primary\_shard\_size of 50 gigabytes or a max\_age of 30 days.  
> A delete phase that sets min\_age to remove the index 90 days after rollover.  
> The min\_age value is relative to the rollover time, not the index creation time.

So in your case say it takes 3 days to `rollover` in hot then `min_age` warm is 7days after that so a total of 10 days before warm.

Of course if you have enough volume to `rollover` in 1 day or less then the rest of the `min_age` will be the number of days plus the fraction of a day it took to `rollover`
