当我启动logstash时,旧日志不会导入ES.
只有新的请求日志记录在ES中.
现在我在doc中看到了这一点.
即使我设置了start_position =>“开头”,也不会插入旧日志.
这只发生在我在linux上运行logstash时.
如果我使用相同的配置运行它,则会导入旧日志.
我甚至不需要在Windows上设置start_position =>“开始”.
对此有何想法?
解决方法:
当您将输入日志读取到Logstash时,Logstash将记录它在此文件上读取的位置,即调用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*"
因此,如果要导入旧日志文件,则必须删除$HOME处的所有.sincedb *.
然后,你需要设置
start_position=>”beginning”
在您的配置文件中.
希望这可以帮到你.
标签:linux,elasticsearch,logstash
来源: https://codeday.me/bug/20190517/1120096.html