我在 AWS 上使用 td-agent v3 并注意到使用 exec_filter 插件时日志卡住了。如果我将存储在缓冲区文件中的日志数与第二个匹配块中打印到标准输出的日志数进行比较,我可以确认缺少日志。但是,如果我重新启动 td-agent 服务,则会出现丢失的日志。此外,如果我发送新日志,则会出现丢失的日志。
我已经确认 python 脚本没有过滤/排除任何记录。我还确认缓冲区部分工作正常。如果我用 stdout 替换 exec_filter,我可以看到所有日志记录在缓冲区刷新后打印。
可能的原因是什么?exec_filter 是否有最小日志大小要求?
下面是我的配置。
<system>
log_level debug
log_event_verbose 1
</system>
<source>
@type http
@id input_http
port 8888
<parse>
@type multi_format
<pattern>
format json
</pattern>
<pattern>
format none
</pattern>
</parse>
@log_level debug
</source>
<match original_tag>
@type exec_filter
tag new_tag
command python3 transform.py
<format>
@type json
</format>
<parse>
@type json
</parse>
<buffer>
@type file
path /var/log/buffer
flush_interval 1m
chunk_limit_size 256M
</buffer>
@log_level debug
</match>
<match new_tag>
@type stdout
</match>