fluent
简介
Logger for Fluentd/Fluent Bit
接入方式
- Fluentd守护进程必须监听一个TCP端口用于日志转发;为了便于测试,这里添加了一个记录到标准输出的匹配器。
# fluentd.conf
<source>
type forward
port 24224
</source>
<match fluentd.test.**>
type stdout
</match>
- 启动Fluentd守护进程。
fluentd -c fluentd.conf
- 参考样例接入pkg.fluent,可以看到Fluentd控制台输出内容。
2024-08-28 02:15:38.000000000 -0400 fluentd.test.follow: {"from":"userA","to":"userB"}
- 通过配置,可以将日志记录到各种存储媒介。