[Logstash] 如何找到并清空logstash-input-file插件的文件监控记录(sincedb)?

本文介绍了如何在Logstash 2.4.1中找到并清除logstash-input-file插件的文件监控记录,即sincedb文件。由于sincedb是隐藏文件,需通过显示所有文件命令找到,然后在停止Logstash服务后使用rm命令删除。删除sincedb前务必停止Logstash,并确保已从Elasticsearch中移除相关文档,以防止导入重复数据。
摘要由CSDN通过智能技术生成

Logstash版本

2.4.1

问题

在Logstash中,已经通过logstash-input-file插件导入了一些本地日志文件。现在需要重新导入这些日志文件,但是logstash-input-file插件会自动忽略之前已经读取的文件。要想重新导入之前的文件,只能清空文件监控记录。

 

那么,文件监控记录到底在哪里?

 

官方插件说明文档中,关于文件监控记录(sincedb)的说明:

 The plugin keeps track of the current position in each file byrecording it in a separate file named sincedb. Thismakes it possible to stop and restart Logstash and have it pick up where itleft off without missing the lines that were added to the file while Logstashwas stopped

......

By default, the sincedb file is placed in the home directory of the user running Logstash

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值