close 和 clean配置只針對匹配不上path且有inode信息時生效。
- 當非匹配path時的文件,如果已被close更新後則無法獲取,當重命名爲匹配時則會重斷點處獲取(因爲註冊文件保存了其狀態inode和偏移量)。
- 當close且ignore時,當重命名爲匹配時,ignore之前的更新不會獲取,當新產生更新後會從之前的斷點開始一併獲取。
- 當close且ignore且clean後,當重命名爲匹配時也無法獲取。
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