The drop
stage uses RE2 (see drop | Grafana Loki documentation), so when testing you’ll want to make sure you select golang and version 2.
It’s a pain in general to write regex not containing something. So I recommend you to do it the other way around. Mock logic below:
- Use regex to group capture string
oom-killer
. - Use match stage to match the group capture for anything that’s not oom-killer, then drop.
- Whatever else can be put after the match/drop stage.
Mock config (not tested):
pipeline_stages:
- regex:
expression: ".*(?P<drop_key>oom-killer).*"
- labels:
drop_key:
- match:
selector: '{drop_key!="oom-killer"}'
action: drop
<whatever else>