filebeat优化参数
html
filebeat的配置文件filebeat.yml,其实有两个参数,windows
close_older: 1happ
说明:Close older closes the file handler for which were not modified for longer then close_older. Time strings like 2h (2 hours), 5m (5 minutes) can be used.ide
即若是一个文件在某个时间段内没有发生过更新,则关闭监控的文件handle,默认1小时。
优化
force_close_files: falsethis
说明:This option closes a file, as soon as the file name changes. This config option is recommended on windows only. Filebeat keeps the files it's reading open. This can cause issues when the file is removed, as the file will not be fully removed until also Filebeat closes the reading. Filebeat closes the file handler after ignore_older. During this time no new file with the same name can be created. Turning this feature on the other hand can lead to loss of data on rotate files. It can happen that after file rotation the beginning of the new file is skipped, as the reading starts at the end. We recommend to leave this option on false but lower the ignore_older value to release files faster.
spa
即当文件名称有变化时,包括更名和删除,会自动关闭一个文件。日志
这两个参数结合起来,根据应用需求,一个文件30分钟内不更新,则须要关闭句柄,文件更名或删除,须要关闭句柄,htm
close_older: 30m
blogforce_close_files: true
能够知足,filebeat采集日志,以及定时删除历史文件,这两个任务的基本要求。
filebeat部署连接
http://www.javashuo.com/article/p-gnyvefiz-kw.html
从零进阶--教你如何使用Filebeat实现日志可视化收集