我使用Grafana loki设置了fluentd,因为我有多个微服务将日志传播到fluentd,所以我无法区分和过滤grafana中的日志。谁能帮我把我的标签添加为标签,这样我就可以像在grafana { tag :"tag.name"}中那样查询它。下面添加了我的fluentd配置。
<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>发布于 2020-04-30 04:11:52
使用动态标签
<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>https://stackoverflow.com/questions/61510794
复制相似问题