Promtail drop certain logs

Hello, team!
I would like to find way to drop certain logs. Is there any example how to do that?

Thank you so much in an advance!


You can use pipeline stages to filter, refer to this documentation:


The match stage conditionally executes a set of stages when a log entry matches a configurable LogQL stream selector.

Hope it helps.

Good Luck

Thank you! I will take a look at it!

I have the same question as well.
here is what I am trying to do.

      - cri: {}
      - match:
          selector: '{app_kubernetes_io_name="ingress-nginx"}'
          action: drop
      - labels:
          cluster: rancher

However, this doesn’t really work because the selector doesn’t catch anything

The label is like ingress-nginx

What is the correct syntax to do this?

I have tried __meta_kubernetes_pod_label_app_kubernetes_io_name and it doesn’t work either.



If you are setting up for the first time, i suggest you follow the setup on this article (configuration side)

Hope it helps.

Good Luck