我在 K8s 集群中设置了 EFK 堆栈。目前 fluentd 正在从所有容器中抓取日志。
我希望它只从容器A
、B
和.C
D
如果我有一些前缀 asA-app
我可以做类似下面的事情。
"fluentd-inputs.conf": "# HTTP input for the liveness and readiness probes
<source>
@type http
port 9880
</source>
# Get the logs from the containers running in the node
<source>
@type tail
path /var/log/containers/*-app.log // what can I put here for multiple different containers
# exclude Fluentd logs
exclude_path /var/log/containers/*fluentd*.log
pos_file /opt/bitnami/fluentd/logs/buffers/fluentd-docker.pos
tag kubernetes.*
read_from_head true
<parse>
@type json
</parse>
</source>
# enrich with kubernetes metadata
<filter kubernetes.**>
@type kubernetes_metadata
</filter>