ilogtail
ilogtail copied to clipboard
[FEATURE]: 支持copytruncate日志轮转模式采集
Concisely describe the proposed feature copytruncate虽然不是推荐的日志轮转方式,但事实上就是一种绕不开的场景。
- 它是系统自带运维工具logrotate的工作方式之一
- 开源采集器都会明确提到对这个模式的支持情况 i. fluentbit https://docs.fluentbit.io/manual/pipeline/inputs/tail#file-rotation ii. vector https://vector.dev/docs/reference/configuration/sources/file/#file-rotation iii. filebeat https://www.elastic.co/guide/en/beats/filebeat/current/file-log-rotation.html
其中filebeat似乎已经解决了copytruncate重复采集日志的问题,ilogtail可以进行参考,RP https://github.com/elastic/beats/pull/23457
Describe the solution you'd like (if any) 当前ilogtail对于这种模式,需要将文件名配置为xxx.log.*会重复采集,配置为xxx.log可能会丢失数据。 采集使用copytruncate模式的日志时,采集丢失、重复情况与fluentbit、filebeat等表现相当。