【问题标题】:Fluentd Dynamic Labeling for Grafana LokiGrafana Loki 的 Fluentd 动态标签
【发布时间】:2020-04-29 20:09:58
【问题描述】:

我用 grafana loki 设置了 fluentd,由于我有多个微服务将日志传播到 fluentd,我无法区分和过滤 Grafana 中的日志。谁能帮我将我的标签添加为标签,以便我可以像在 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>

【问题讨论】:

    标签: grafana fluentd grafana-loki


    【解决方案1】:

    使用动态标签

    <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>
    

    【讨论】:

      猜你喜欢
      • 2023-01-04
      • 1970-01-01
      • 2020-07-13
      • 2021-12-19
      • 2020-10-17
      • 2023-01-19
      • 2018-10-29
      • 2022-12-10
      • 2020-09-07
      相关资源
      最近更新 更多