I think you are overthinking this a bit. I can think of two potential solutions:
- Log everything except
batch job running
. Something like this should work:
pipeline_stages:
- regex:
expression: ^(?P<is_batch_job_running>batch\sjob\srunning)$
- labels:
is_batch_job_running:
- match:
selector: '{is_batch_job_running=~"^batch\sjob\srunning$"}'
action: drop
drop_counter_reason: batch_job_running
- What is the motivation behind not wanting to log the
batch job running
line? It’s pretty easy to exclude a matching line with LogQL if you wish to not display it in Grafana.
Personally I’d recommend #2. In general keeping your log forwarding logic as simple as possible should be more preferable in my opinion.