【发布时间】:2021-02-02 14:57:34
【问题描述】:
我的 Kubernetes 集群中有一个以 DaemonSet 身份运行的 Fluentd。多个应用程序以微服务的形式部署在集群上,跨命名空间,名称与微服务名称相同。
微服务(名称为payments)将日志输出到stdout。我想解析该微服务日志并将其放到 Fluentd 中的某个目的地。问题是我只想要特定的微服务payments 日志。如果我使用:
<source>
@type tail
@id in_tail_container_logs
path /var/log/containers/*.log
pos_file /var/log/fluentd-containers.log.pos
tag kubernetes.*
read_from_head true
....
</source>
它将扫描所有将日志输出到stdout 的 pod 我想过滤那个特定的微服务日志。有没有办法在 Fluentd 中做到这一点?谢谢
【问题讨论】:
标签: kubernetes microservices fluentd