我正在将EFK堆栈安装到100天前的集群。Fluentd将拾取100天的日志,并开始发送到Elastic。是否有规定fluentd从今天开始聚合日志,而不是从集群的生命周期开始?
发布于 2019-09-30 17:22:01
如果你查看Fluentd documentation,你可以找到limit_recently_modified标志,它允许限制观看文件的修改时间在指定的时间范围内。
下面是如何在conf文件中使用limit_recently_modified:
...
<source>
exclude_path ["/var/log/wedge/*/*/MattDaemon*.log"]
path_key source
format none
read_from_head true
tag foo.*
path /var/log/wedge/*/*/*.log
pos_file /var/log/td-agent/wedgelog
limit_recently_modified 86400s
@type tail
</source>
...另一种选择是使用Filebeat (而不是Fluentd),您可以在其中找到ignore_older标志。Filebeat将忽略在指定时间间隔之前修改的任何文件。
我希望它能对你有所帮助。
https://stackoverflow.com/questions/58120936
复制相似问题