[英]Fluentd Dynamic Labeling for Grafana Loki
我用 grafana loki 設置了 fluentd,由於我有多個微服務將日志傳播到 fluentd,我無法區分和過濾 Grafana 中的日志。 誰能幫我將我的標簽添加為 label 以便我可以像在 grafana {tag:"tag.name"} 中查詢它。 我在下面添加了流利的配置。
<match TEST.**>
@type loki
url "http://localhost:3100"
flush_interval 1s
flush_at_shutdown true
buffer_chunk_limit 1m
extra_labels {"job":"TEST", "host":"ward_workstation", "agent":"fluentd"}
<label>
filename
</label>
</match>
使用動態標簽
<filter TEST.**>
@Type record_transformer
<record>
tag_name ${tag}
</record>
</filter>
<match TEST.**>
@type loki
url "http://localhost:3100"
flush_interval 1s
flush_at_shutdown true
buffer_chunk_limit 1m
extra_labels {"job":"TEST", "host":"ward_workstation", "agent":"fluentd"}
<label>
tag_name
</label>
</match>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.