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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章