# Elasticsearch index name with date/time

**URL:** <https://discuss.elastic.co/t/elasticsearch-index-name-with-date-time/209259>\
**Category:** Elasticsearch\
**Created:** [November 25, 2019, 9:26am UTC](https://discuss.elastic.co/t/elasticsearch-index-name-with-date-time/209259 "2019-11-25T09:26:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAM\_NATHAN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_nathan/32/50393_2.png) [@RAM\_NATHAN](https://discuss.elastic.co/u/RAM_NATHAN)\
**Post date:** [November 25, 2019, 9:26am UTC](https://discuss.elastic.co/t/elasticsearch-index-name-with-date-time/209259/1 "2019-11-25T09:26:35Z")

</div>

Hi

I have created a index as "test-000001" and alias as "test\_search"  
I have given rollover action as below

action: rollover  
description: \>-  
Rollover the index associated with alias 'aliasname', which should be in the  
form of prefix-000001 (or similar), or prefix-YYYY.MM.DD-1.  
options:  
name: test\_search  
conditions:  
max\_age: 1h

Every 1 hour, its creating index as test-000002, test-000003, etc.

But I prefer to have date instead of 000001

I saw i can give newindex : test-{now/d{YYYY.MM.dd.HH}}-1. But how to create a first index with same format?? Means right now I manually create first index as  
PUT test-000001

I'm searching something like

PUT test-YYYY.MM.dd.HH

Is it possible???

---

<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 23, 2019, 9:26am UTC](https://discuss.elastic.co/t/elasticsearch-index-name-with-date-time/209259/2 "2019-12-23T09:26:36Z")

</div>

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