# \[logstash-input-file\] when I rename file and restart , logstash will read duplication

**URL:** <https://discuss.elastic.co/t/logstash-input-file-when-i-rename-file-and-restart-logstash-will-read-duplication/225559>\
**Category:** Logstash\
**Created:** [March 29, 2020, 2:37pm UTC](https://discuss.elastic.co/t/logstash-input-file-when-i-rename-file-and-restart-logstash-will-read-duplication/225559 "2020-03-29T14:37:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antido-L](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antido-l/32/68930_2.png) [@Antido-L](https://discuss.elastic.co/u/Antido-L)\
**Post date:** [March 29, 2020, 2:37pm UTC](https://discuss.elastic.co/t/logstash-input-file-when-i-rename-file-and-restart-logstash-will-read-duplication/225559/1 "2020-03-29T14:37:35Z")

</div>

I use logstash-input-file-plugin.  
when I rename file and restart , logstash will read duplication.

I rotate log in the way renaming method.

The scene is as follows：  
During the logstash shutdown, the **service.log** is renamed **service.log.2020-03-06** and create a new file named **service.log** , when I restart logstash, it will reread content in **service.log.2020-03-06**.  
Are there any good suggestions to avoid this situation？

config:  
input {  
file {  
path =\> ["/home/service.\*”]  
start\_position =\> "beginning"  
}  
}

logstash version: logstash-7.6.0

---

<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:** [April 26, 2020, 2:37pm UTC](https://discuss.elastic.co/t/logstash-input-file-when-i-rename-file-and-restart-logstash-will-read-duplication/225559/2 "2020-04-26T14:37:43Z")

</div>

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