filebeat close和clean配置解读

close clean配置只针对匹配不上path且有inode信息时生效。

  1. 当非匹配path时的文件,如果已被close更新后则无法获取,当重命名为匹配时则会重断点处获取(因为注册文件保存了其状态inode和偏移量)。
  2. closeignore时,当重命名为匹配时,ignore之前的更新不会获取,当新产生更新后会从之前的断点开始一并获取。
  3. closeignoreclean,当重命名为匹配时也无法获取。
filebeat.inputs:
- type: log
  # Change to true to enable this input configuration.
  enabled: true
  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /home/admin/statistics/logdyb/statis.log
    - /home/admin/statistics/logdyb/statis.log.*.retry   
    #在log4j日志重命名场景下,当同步服务filebeat失败后重新恢复时,可以通过将日志重命名为.retry已实现断点重传;
    #重传有效时间为ignore_older,手动更新触发重传时间限为clean_inactive.
  exclude_files: ['.COMPLETED$']
  encoding: utf-8
  tail_files: false
  close_inactive: 30m
  close_removed: false
  clean_removed: false
  ignore_older: 72h
  clean_inactive: 168h
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章