# Index name removes date

**URL:** <https://discuss.elastic.co/t/index-name-removes-date/204705>\
**Category:** Logstash\
**Created:** [October 22, 2019, 5:56pm UTC](https://discuss.elastic.co/t/index-name-removes-date/204705 "2019-10-22T17:56:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_McAfee1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_mcafee1/32/47236_2.png) [@John\_McAfee1](https://discuss.elastic.co/u/John_McAfee1)\
**Post date:** [October 22, 2019, 5:56pm UTC](https://discuss.elastic.co/t/index-name-removes-date/204705/1 "2019-10-22T17:56:15Z")

</div>

Hello,

I am using Logstash 7.2.0 and have encountered an issue with naming my index with a timestamp. An index is created in Logstash, but it doesn't contain the date. It only contains the characters before the dash. For example, if the index is named performance-%{YYYY.MM.dd} the index created in Elasticsearch is only performance- and the date is missing.

My output config is:  
output {  
stdout { codec =\> rubydebug }  
elasticsearch {  
hosts =\> ["10.x.x.x:9200"]  
user =\> "user"  
password =\> "password"  
action =\> "update"  
doc\_as\_upsert =\> true  
document\_id =\> "%{uuid}"  
index =\> "test-%{+YYYY.MM.dd}"  
}  
}

I also tried lowercase yyyy thinking maybe the syntx is incorrect. but it did not work either.

Thanks,

John

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 22, 2019, 7:54pm UTC](https://discuss.elastic.co/t/index-name-removes-date/204705/2 "2019-10-22T19:54:29Z")

</div>

My reading of the [code](https://github.com/elastic/logstash/blob/fb0bf43690acc81cec912b29c30ca514919f2928/logstash-core/src/main/java/org/logstash/StringInterpolation.java#L58) is that that means you have deleted the @timestamp field.

---

<div class="post-metadata">

**Author:** ![John\_McAfee1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_mcafee1/32/47236_2.png) [@John\_McAfee1](https://discuss.elastic.co/u/John_McAfee1)\
**Post date:** [October 23, 2019, 2:46pm UTC](https://discuss.elastic.co/t/index-name-removes-date/204705/3 "2019-10-23T14:46:07Z")

</div>

Thank you! Not sure why I did that, but that was definitely the problem.

---

<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:** [November 20, 2019, 2:46pm UTC](https://discuss.elastic.co/t/index-name-removes-date/204705/4 "2019-11-20T14:46:14Z")

</div>

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