# Want to create new index daily with date associated with index name

**URL:** <https://discuss.elastic.co/t/want-to-create-new-index-daily-with-date-associated-with-index-name/346197>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [November 1, 2023, 12:31pm UTC](https://discuss.elastic.co/t/want-to-create-new-index-daily-with-date-associated-with-index-name/346197 "2023-11-01T12:31:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swapnadeep\_Mondal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swapnadeep_mondal/32/92703_2.png) [@Swapnadeep\_Mondal](https://discuss.elastic.co/u/Swapnadeep_Mondal)\
**Post date:** [November 1, 2023, 12:31pm UTC](https://discuss.elastic.co/t/want-to-create-new-index-daily-with-date-associated-with-index-name/346197/1 "2023-11-01T12:31:53Z")

</div>

Hello Team,

I've recently learned about date math and I'm interested in creating an ILM (Index Lifecycle Management) policy to generate a new index every day, with the index name associated with the date. For example, I would like the indices to be named like this: report-2023-11-01, report-2023-11-02, and so on.

Could someone assist me with this? Is it possible to create a template using date math for this purpose?

---

<div class="post-metadata">

**Author:** ![Swapnadeep\_Mondal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swapnadeep_mondal/32/92703_2.png) [@Swapnadeep\_Mondal](https://discuss.elastic.co/u/Swapnadeep_Mondal)\
**Post date:** [November 10, 2023, 6:32am UTC](https://discuss.elastic.co/t/want-to-create-new-index-daily-with-date-associated-with-index-name/346197/2 "2023-11-10T06:32:56Z")

</div>

Hi Team,

Any help ?

---

<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 10, 2023, 6:57am UTC](https://discuss.elastic.co/t/want-to-create-new-index-daily-with-date-associated-with-index-name/346197/3 "2023-11-10T06:57:22Z")

</div>

This is the traditional way of creating time-based indices, and this method typically relies on the process indexing data into Elasticsearch to determine the index name and direct the document there. Although you might be able to do this within an ingest template, there is no built in support within Elasticsearch for this.

You can still create an ILM policy that does not use rollover and link it to the time-based indices you create through an index template. The retention will in this case be based on the index creation date.

---

<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 8, 2023, 6:57am UTC](https://discuss.elastic.co/t/want-to-create-new-index-daily-with-date-associated-with-index-name/346197/4 "2023-12-08T06:57:42Z")

</div>

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