[Filebeat] ignore_older 와 tail_files 관련.

Elastic/Beats 2021. 10. 7. 19:08

이 두 설정은 같이 고려 하는게 좋습니다.

각 설정은 아래 공홈 문서 참고 하시면 됩니다.

 

https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html#filebeat-input-log-ignore-older

https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html#_tail_files_3

 

[Case 1] filebeat 재시작 시 데이터 유실 없이 사용하기 위한 설정

filebeat.inputs:
- type: log
...중략...
  ignore_older: 0
  tail_files: false
...중략...

 

[Case 2] filebeat 빠른 재시작 시 사용하기 위한 설정

filebeat.inputs:
- type: log
...중략...
  ignore_older: 10m
  tail_files: true
...중략...

가볍게 설정에 대해서 알아보면,

- ignore_older 는 파일의 시간을 가지고 설정된 시간이 지난 파일은 무시 하게 됩니다.

- tail_files 는 파일의 처음 부터 읽을 건지 마지막 부터 읽을 건지 설정을 하게 됩니다.

 

: