# Manual creation of an index with the date pattern name-YYYY.MM.DD

**URL:** <https://discuss.elastic.co/t/manual-creation-of-an-index-with-the-date-pattern-name-yyyy-mm-dd/128730>\
**Category:** Elasticsearch\
**Created:** [April 19, 2018, 2:46pm UTC](https://discuss.elastic.co/t/manual-creation-of-an-index-with-the-date-pattern-name-yyyy-mm-dd/128730 "2018-04-19T14:46:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chapmantrain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chapmantrain/32/22646_2.png) [@chapmantrain](https://discuss.elastic.co/u/chapmantrain)\
**Post date:** [April 19, 2018, 2:46pm UTC](https://discuss.elastic.co/t/manual-creation-of-an-index-with-the-date-pattern-name-yyyy-mm-dd/128730/1 "2018-04-19T14:46:56Z")

</div>

I have an application that will be feeding data to my cluster via the API. I would like to have the index rolled like a logstash feed, index-YYYY.MM.DD. I cannot figure out how to create the index for that pattern? I don't think this is a rollover. It appears rollover just uses a numeric counter for the pattern. We would like the date pattern as we will be using Curator to maintain our retention policy. Thanks for the help.

UT /logs-000001  
{  
"aliases": {  
"logs\_write": {}  
}  
}

# Add \> 1000 documents to logs-000001

POST /logs\_write/\_rollover  
{  
"conditions": {  
"max\_age": "7d",  
"max\_docs": 1000,  
"max\_size": "5gb"  
}  
}

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [April 19, 2018, 3:06pm UTC](https://discuss.elastic.co/t/manual-creation-of-an-index-with-the-date-pattern-name-yyyy-mm-dd/128730/2 "2018-04-19T15:06:56Z")

</div>

Curator doesn't need to have a date stamp in the index name. You can use [`field_stats` based ages](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/filtertype_age.html#_literal_field_stats_literal_based_ages) in Curator to identify the oldest and/or youngest `@timestamp` field in the index, removing the need to put a timestamp in the index name.

You're much better off using a default numeric rollover naming sequence to achieve this, with the aforementioned `field_stats` approach in Curator. But if you _must_ put a timestamp in your index name with a rollover approach, see [this forum post](https://discuss.elastic.co/t/how-can-i-name-curator-rollover-new-index-like-date-prefix-yyyy-mm-dd-1/128542/2?u=theuntergeek).

---

<div class="post-metadata">

**Author:** ![chapmantrain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chapmantrain/32/22646_2.png) [@chapmantrain](https://discuss.elastic.co/u/chapmantrain)\
**Post date:** [April 19, 2018, 4:22pm UTC](https://discuss.elastic.co/t/manual-creation-of-an-index-with-the-date-pattern-name-yyyy-mm-dd/128730/3 "2018-04-19T16:22:07Z")

</div>

Thanks for that suggestion Aaron, I see the wisdom.

---

<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:** [May 17, 2018, 4:22pm UTC](https://discuss.elastic.co/t/manual-creation-of-an-index-with-the-date-pattern-name-yyyy-mm-dd/128730/4 "2018-05-17T16:22:12Z")

</div>

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