Modify `promtail` config for `init` journal.

This commit is contained in:
Kazuhiro MUSASHI 2020-09-21 00:19:52 +09:00
parent 6cabd89504
commit 81822f12d3
1 changed files with 21 additions and 1 deletions

View File

@ -208,9 +208,29 @@ scrape_configs:
path: /var/log/journal path: /var/log/journal
labels: labels:
job: init job: init
level: notice
hostname: <%= @HOSTNAME %> hostname: <%= @HOSTNAME %>
pipeline_stages:
- match:
selector: '{job="init"} |~ "(apt download|Message of the Day)"'
stages:
- template:
source: level
template: 'info'
- labels:
level:
- match:
selector: '{job="init"} !~ "(apt download|Message of the Day)"'
stages:
- template:
source: level
template: 'notice'
- labels:
level:
relabel_configs: relabel_configs:
- action: keep - action: keep
regex: 'init\.scope' regex: 'init\.scope'