Loki.process How to only process different conditions or tags

loki.process How to only process different conditions or tags。


loki.process "pod_logs" {
  stage.static_labels {
      values = {
        cluster = "production",
      }
  }

  forward_to = [loki.write.default.receiver]
}

Use match: loki.process | Grafana Alloy documentation

It’ll look something like

loki.process "pod_logs" {
  forward_to = [loki.write.default.receiver]

  stage.match {
    selector = <some_condition>

    <actions>
  }
  
  stage.match {
    selector = <some_condition>

    <actions>
  }
}