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