# Rolling-over with daily index using ILM policy

**URL:** https://discuss.elastic.co/t/rolling-over-with-daily-index-using-ilm-policy/237586
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [June 18, 2020, 7:58am UTC](https://discuss.elastic.co/t/rolling-over-with-daily-index-using-ilm-policy/237586 "2020-06-18T07:58:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sachith\_Senarathne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sachith_senarathne/32/70603_2.png) [@Sachith\_Senarathne](https://discuss.elastic.co/u/Sachith_Senarathne)
#### Post date: [June 18, 2020, 7:58am UTC](https://discuss.elastic.co/t/rolling-over-with-daily-index-using-ilm-policy/237586/1 "2020-06-18T07:58:36Z")

</div>

Hi  
We are in the process of creating an index template including ilm policy which has mentioned below.

```auto
                {
                "policy": {
                    "phases": {
                        "hot": {
                            "actions": {
                                "rollover": {
                                    "max_size": "10GB",
                                    "max_age": "1d"
                                }
                            }
                        },
                        "delete": {
                            "min_age": "7d",
                            "actions": {
                                "delete": {}
                            }
                        }
                    }
                }
            }

```

Expected use-case: We are expecting to rollover the created index daily, which means at the end of the day. At 12.00 am (0000h) we are expecting the new index to be created with the current date appended to the index name. So the name format we are expecting in indexes is my-log-yyyy-MM-dd. But the ILM policy we are currently having is not catering to the requirement. When we are bootstrapping the cluster, by giving the date patter it will result in a name like **my-log-2020-06-18** as its name, but rolling over will happen with the appended number to that but not with the increased date. ie. _ **my-log-2020-06-18-00001** _ to _ **my-log-2020-06-18-00002** _. Please advise on this.

---

<div class="post-metadata">

### Author: ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)
#### Post date: [June 27, 2020, 4:01am UTC](https://discuss.elastic.co/t/rolling-over-with-daily-index-using-ilm-policy/237586/2 "2020-06-27T04:01:26Z")

</div>

In order to have the name automatically updated, you need to make sure that the original index was created with date math, so for your latest index, if you retrieve the settings and look for the `provided_name` setting, you can see whether date math was used.

For the index, you need to use `<my-log-{now/d}-000001>` when you create it.

---

<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 25, 2020, 4:01am UTC](https://discuss.elastic.co/t/rolling-over-with-daily-index-using-ilm-policy/237586/3 "2020-07-25T04:01:43Z")

</div>

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