Search code examples
grafana-lokipromtail

Drop logs from promtail


I have prometheus + loki + grafana + promtail setup. I need to drop the logs which have the words healthcheck or health-check.

My values.yaml file: https://github.com/grafana/helm-charts/blob/main/charts/promtail/values.yaml

Please help me how can I do it.


Solution

  • You can do this at the filtering stage in the pipeline

    pipelineStages:
    # - cri: {}
    - drop:
        expression: "(.*/health-check.*)|(.*/health.*)"
    

    docs