# Change index file name from logstash command

**URL:** <https://discuss.elastic.co/t/change-index-file-name-from-logstash-command/258532>\
**Category:** Logstash\
**Created:** [December 14, 2020, 4:54am UTC](https://discuss.elastic.co/t/change-index-file-name-from-logstash-command/258532 "2020-12-14T04:54:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aryaman\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aryaman_gupta/32/79927_2.png) [@Aryaman\_Gupta](https://discuss.elastic.co/u/Aryaman_Gupta)\
**Post date:** [December 14, 2020, 4:54am UTC](https://discuss.elastic.co/t/change-index-file-name-from-logstash-command/258532/1 "2020-12-14T04:54:46Z")

</div>

Is there any way to give custom name to index file in logstash config file every-time I run log-stash command?

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "global7679-%{+YYYY.MM.dd}" \<----- Need to change this name  
}  
}

---

<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:** [January 11, 2021, 4:54am UTC](https://discuss.elastic.co/t/change-index-file-name-from-logstash-command/258532/2 "2021-01-11T04:54:46Z")

</div>

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