Merge branch 'promtail-consul' of kazu634/itamae into master

This commit is contained in:
Kazuhiro MUSASHI 2020-09-21 00:17:11 +09:00 committed by Gitea
commit 6cabd89504
1 changed files with 38 additions and 0 deletions

View File

@ -242,3 +242,41 @@ scrape_configs:
regex: '.*(cron|supervisor|ssh|promtail|local|grafana|motd|dnsmasq|snapd|logind|init|session|loki|monit).*'
source_labels:
- __journal__systemd_unit
- job_name: consul
static_configs:
- targets:
- localhost
labels:
job: consul
hostname: <%= @HOSTNAME %>
__path__: /var/log/supervisor/consul.log
pipeline_stages:
- match:
selector: '{job="consul"}'
stages:
- regex:
expression: '^ +(?P<timestamp>\d+-\d+-[^T]+T\d+:\d+:\d+\.\d+\+\d+) \[(?P<level>[^\]]+)\] (?P<message>.+)$'
- timestamp:
source: timestamp
format: 2006-01-02T15:04:05.000-0700
- template:
source: level
template: '{{ ToLower .level }}'
- template:
source: level
template: '{{ regexReplaceAllLiteral "warn" .Value "warning" }}'
- template:
source: level
template: '{{ regexReplaceAllLiteral "crit" .Value "critical" }}'
- labels:
level:
- output:
source: message