Hello.
I want logs only message with pattern oom-killer. I tested regex in regex101, but in promtail not work. Can i log message with only “oom-killer” pattern?
/usr/local/bin/promtail -config.file=/etc/promtail/promtail.yml -log.level=debug -config.expand-env=false --dry-run --inspect
echo “oom-test” | systemd-cat
2024-02-29T13:28:00.397881+0000{job=“systemd-journal”}oom-test
level=debug ts=2024-02-29T13:28:00.712036544Z caller=drop.go:217 component=journal_pipeline component=stage type=drop msg=“line will not be dropped, the provided regular expression did not match the log line”
scrape_configs:
- job_name: journal
journal:
max_age: 12h
labels:
job: systemd-journal
hostname: ''
relabel_configs:
- source_labels: ["_journal_systemd_unit"]
target_label: "unit"
pipeline_stages:
- drop:
expression: ".*!?oom-killer.*"