Merge branch 'promtail-journal-modify' of kazu634/itamae into master
This commit is contained in:
commit
b1ea22a262
|
@ -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'
|
||||||
|
@ -229,11 +249,36 @@ scrape_configs:
|
||||||
|
|
||||||
pipeline_stages:
|
pipeline_stages:
|
||||||
- match:
|
- match:
|
||||||
selector: '{job="systemd"}'
|
selector: '{job="systemd"} !~ "temperature"'
|
||||||
stages:
|
stages:
|
||||||
- drop:
|
- drop:
|
||||||
expression: (CMD|UFW|session|TTY)
|
expression: (CMD|UFW|session|TTY)
|
||||||
|
|
||||||
|
- match:
|
||||||
|
selector: '{job="systemd"} |~ "temperature"'
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- regex:
|
||||||
|
expression: '^(?P<message>.+)$'
|
||||||
|
|
||||||
|
- template:
|
||||||
|
source: level
|
||||||
|
template: '{{ .message }}'
|
||||||
|
|
||||||
|
- template:
|
||||||
|
source: level
|
||||||
|
template: '{{ regexReplaceAllLiteral ".*normal.*" .Value "notice" }}'
|
||||||
|
|
||||||
|
- template:
|
||||||
|
source: level
|
||||||
|
template: '{{ regexReplaceAllLiteral ".*temperature.*" .Value "error" }}'
|
||||||
|
|
||||||
|
- labels:
|
||||||
|
level:
|
||||||
|
|
||||||
|
- output:
|
||||||
|
source: message
|
||||||
|
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: ['__journal__systemd_unit']
|
- source_labels: ['__journal__systemd_unit']
|
||||||
target_label: 'unit'
|
target_label: 'unit'
|
||||||
|
|
Loading…
Reference in New Issue