Monitor systemd journal.
This commit is contained in:
parent
21012e2d5b
commit
9e91a66819
|
@ -201,6 +201,22 @@ scrape_configs:
|
||||||
source_labels:
|
source_labels:
|
||||||
- __journal__systemd_unit
|
- __journal__systemd_unit
|
||||||
|
|
||||||
|
- job_name: init
|
||||||
|
journal:
|
||||||
|
json: false
|
||||||
|
max_age: 12h
|
||||||
|
path: /var/log/journal
|
||||||
|
labels:
|
||||||
|
job: init
|
||||||
|
level: notice
|
||||||
|
hostname: <%= @HOSTNAME %>
|
||||||
|
|
||||||
|
relabel_configs:
|
||||||
|
- action: keep
|
||||||
|
regex: 'init\.scope'
|
||||||
|
source_labels:
|
||||||
|
- __journal__systemd_unit
|
||||||
|
|
||||||
- job_name: systemd
|
- job_name: systemd
|
||||||
journal:
|
journal:
|
||||||
json: false
|
json: false
|
||||||
|
@ -211,13 +227,18 @@ scrape_configs:
|
||||||
level: info
|
level: info
|
||||||
hostname: <%= @HOSTNAME %>
|
hostname: <%= @HOSTNAME %>
|
||||||
|
|
||||||
|
pipeline_stages:
|
||||||
|
- match:
|
||||||
|
selector: '{job="systemd"}'
|
||||||
|
stages:
|
||||||
|
- drop:
|
||||||
|
expression: (CMD|UFW|session|TTY)
|
||||||
|
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- action: keep
|
- source_labels: ['__journal__systemd_unit']
|
||||||
regex: '.*\.service'
|
target_label: 'unit'
|
||||||
source_labels:
|
|
||||||
- __journal__systemd_unit
|
|
||||||
|
|
||||||
- action: drop
|
- action: drop
|
||||||
regex: '.*(cron|supervisor|ssh|promtail|local|grafana|motd|dnsmasq|snapd|logind).*'
|
regex: '.*(cron|supervisor|ssh|promtail|local|grafana|motd|dnsmasq|snapd|logind|init|session|loki|monit).*'
|
||||||
source_labels:
|
source_labels:
|
||||||
- __journal__systemd_unit
|
- __journal__systemd_unit
|
||||||
|
|
Loading…
Reference in New Issue