# Logstash and index recreation

**URL:** <https://discuss.elastic.co/t/logstash-and-index-recreation/178975>\
**Category:** Logstash\
**Created:** [April 29, 2019, 6:25pm UTC](https://discuss.elastic.co/t/logstash-and-index-recreation/178975 "2019-04-29T18:25:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elena\_Kochetkova](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elena_kochetkova/32/40850_2.png) [@Elena\_Kochetkova](https://discuss.elastic.co/u/Elena_Kochetkova)\
**Post date:** [April 29, 2019, 6:25pm UTC](https://discuss.elastic.co/t/logstash-and-index-recreation/178975/1 "2019-04-29T18:25:29Z")

</div>

We had elasticsearch upgraded elasticsearch cluster and accidentally pointed it to the old data directories and ever since we were getting tons of dangling indices log entries. We built a new elasticsearch cluster and my hope was that once I'd point logstash to a new cluster most of the indices will be recreated from file entries. However the only index that was generated was same day index. I am trying to understand why.

Here is an example of logstash .conf file:

input {  
file {  
path =\> [  
"/logs/xxx-\*.log"  
]  
}  
}  
filter {  
grok {  
match =\> ["message","%{TIMESTAMP\_ISO8601:timestamp} [%{DATA:class}] %{LOGLEVEL:severity} %{GREEDYDATA:message}" ]  
overwrite =\> ["message"]  
}  
date {  
match =\> ["timestamp" , "yyyy-MM-dd HH:mm:ss,SSS"]  
target =\> "@timestamp"  
}  
}  
output {  
if "\_grokparsefailure" not in [tags] {  
elasticsearch {  
hosts =\> [“xx.xx.xx.xxx:9200","xx.xx.xx.xxx:9200","xx.xx.xx.xxx:9200","xx.xx.xx.xxx:9200"]  
index =\> “name-appengine-%{+YYYY.MM.dd}"  
}  
}  
}

---

<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:** [April 29, 2019, 6:41pm UTC](https://discuss.elastic.co/t/logstash-and-index-recreation/178975/2 "2019-04-29T18:41:00Z")

</div>

Are you asserting that the @timestamp field is in the past but the string interpolation of the index name uses the current date?

---

<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 27, 2019, 6:41pm UTC](https://discuss.elastic.co/t/logstash-and-index-recreation/178975/3 "2019-05-27T18:41:02Z")

</div>

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