# How to create rolling index with date as the index name?

**URL:** <https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156>\
**Category:** Elasticsearch\
**Created:** [May 5, 2021, 9:22am UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156 "2021-05-05T09:22:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sumeet\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sumeet_singh/32/81258_2.png) [@Sumeet\_Singh](https://discuss.elastic.co/u/Sumeet_Singh)\
**Post date:** [May 5, 2021, 9:22am UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156/1 "2021-05-05T09:22:08Z")

</div>

Hi, my elastic search index will ingest thousands of documents per second. The service which puts documents in the index doesn't creates a new index, instead it just gets current data in nodejs and indexes docs in "log-YYYY.MM.DD". So, we know index is created automatically if not present.

Now, my question is can this practice of creating index and putting docs at the same time cause performance issues or failures given that index wil be ingesting thousands of docs per second ?

If the answer to above question is yes, how can I create a rolling index whitch date as the index name? Say today is 5 May, 2021, so i want automatic creation of index for 6 May, 2021 in the format log-2021.05.06.

---

<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 5, 2021, 9:51am UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156/2 "2021-05-05T09:51:06Z")

</div>

Welcome to our community! 😃

The reason for using these approaches is to reduce performance hits, due to excessively large, or small, shard sizes.

We are moving away from indices with timestamps in them like that, take a look at [ILM](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html) instead.

---

<div class="post-metadata">

**Author:** ![Sumeet\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sumeet_singh/32/81258_2.png) [@Sumeet\_Singh](https://discuss.elastic.co/u/Sumeet_Singh)\
**Post date:** [May 5, 2021, 10:10am UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156/3 "2021-05-05T10:10:05Z")

</div>

Hi @warkolm, I can't change the index name format, "log-YYYY.MM.DD" is what I want because some of my services are dependent on this name.

> The reason for using these approaches is to reduce performance hits, due to excessively large, or small, shard sizes.

Which approach you're talking about? Can you please eleborate more on this?

---

<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 5, 2021, 10:53am UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156/4 "2021-05-05T10:53:40Z")

</div>

That naming convention only allows a single index per day which means rollover can not create a new index when triggered. You therefore either need to index based on time stamp only and skip rollover or add a sequence number that increments (not per day).

---

<div class="post-metadata">

**Author:** ![Sumeet\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sumeet_singh/32/81258_2.png) [@Sumeet\_Singh](https://discuss.elastic.co/u/Sumeet_Singh)\
**Post date:** [May 5, 2021, 11:33am UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156/5 "2021-05-05T11:33:57Z")

</div>

"_log-YYYY.MM.DD-01"_ is this what are you implying here? adding a sequence as suffix but it won't increment the date right? In simple words I want automatic creation of index with date in its name.  
I want to skip the rollover but before that I want to ensure whether there can be performance issues or failures when index is being initialized at the time of ingestion.

---

<div class="post-metadata">

**Author:** ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)\
**Post date:** [May 5, 2021, 4:58pm UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156/6 "2021-05-05T16:58:48Z")

</div>

Sumeet,

Others have addressed the issue of rollover, but I just wanted to answer your first question. The answer is no, you should not see performance issues or failures ingesting thousands of docs per second assuming a properly sized and maintained cluster.

-Andrew

---

<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:** [June 2, 2021, 4:59pm UTC](https://discuss.elastic.co/t/how-to-create-rolling-index-with-date-as-the-index-name/272156/7 "2021-06-02T16:59:30Z")

</div>

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