Old logs are not imported into ES by logstash

前端 未结 2 1479
终归单人心
终归单人心 2021-01-18 23:13

When I start logstash, the old logs are not imported into ES.
Only the new request logs are recorded in ES.
Now I\'ve see this in the doc.

Even if I set the

相关标签:
2条回答
  • 2021-01-18 23:22

    When you read an input log to Logstash, Logstash will keep an record about the position it read on this file, that's call sincedb.

    Where to write the sincedb database (keeps track of the current position of monitored log files). 
    The default will write sincedb files to some path matching "$HOME/.sincedb*"
    

    So, if you want to import old log files, you must delete all the .sincedb* at your $HOME. Then, you need to set

    start_position=>"beginning"

    at your configuration file.

    Hope this can help you.

    0 讨论(0)
  • 2021-01-18 23:45

    Please see this line also.

    This option only modifies "first contact" situations where a file is new and not seen before. If a file has already been seen before, this option has no effect.

    0 讨论(0)
提交回复
热议问题