# How to create index name with date and incremental Number

**URL:** <https://discuss.elastic.co/t/how-to-create-index-name-with-date-and-incremental-number/305923>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [May 30, 2022, 9:13am UTC](https://discuss.elastic.co/t/how-to-create-index-name-with-date-and-incremental-number/305923 "2022-05-30T09:13:05Z")\
**Posts on this page:** 5\
**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:** [May 30, 2022, 9:13am UTC](https://discuss.elastic.co/t/how-to-create-index-name-with-date-and-incremental-number/305923/1 "2022-05-30T09:13:05Z")

</div>

Greetings ..!  
I want to create index from Logstash. The index name should be (index\_name-2022-05-30-001).  
And I set a limit to index is 1.5gb, when it exceeds in the same day, the newly created index name should be index\_name-2022-05-30-002.. When a next day comes in the index name should be index\_name-2022-05-31-001. I Mean to say when a new day comes, the index name should be new date and last 3 digits should come back to 001  
Kindly help me on this. Thanks in advance

---

<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:** [May 30, 2022, 7:23pm UTC](https://discuss.elastic.co/t/how-to-create-index-name-with-date-and-incremental-number/305923/2 "2022-05-30T19:23:51Z")

</div>

I do not think ILM supports this type of daily files with a sequence number per day. When you use rollover there is generally a monotonically increasing sequence number.

---

<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:** [May 31, 2022, 12:55am UTC](https://discuss.elastic.co/t/how-to-create-index-name-with-date-and-incremental-number/305923/3 "2022-05-31T00:55:52Z")

</div>

That is correct. The date in an ILM managed index is the date that the policy was first enacted.

---

<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:** [June 9, 2022, 1:33pm UTC](https://discuss.elastic.co/t/how-to-create-index-name-with-date-and-incremental-number/305923/4 "2022-06-09T13:33:22Z")

</div>

Thanks a lot for your quick response Christian and warkolm

---

<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 7, 2022, 1:34pm UTC](https://discuss.elastic.co/t/how-to-create-index-name-with-date-and-incremental-number/305923/5 "2022-07-07T13:34:22Z")

</div>

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