I need help with promtail configuration where I want to drop all "level=info" lines from all pods, except 2 pods where all lines are needed including level=info.
Can someone please help me with it? I am very new to loki-stack and I am not sure how the configuration works and what is the precedence if I add multiple rules in scrape configs.
Thanks in advance.
Finally I was able to achieve this :
Referred : https://grafana.com/docs/loki/latest/send-data/promtail/stages/ But the documentation should have stated that we can use logql with selector to get the desired filtering. Since I was new to grafana/loki/promtail stack, I didn't recognise it at first from the documentation. It took me sometime to figure it out.
However, the error thrown by promtail is very very bad and does not reflect the exact problem at all. I forgot to add escape char for " in regex expression, and the error I got was :
After wasting couple of hours I realised this mistake and fixed it.
PS: Not sure why the question was marked for close?