itamae/cookbooks/digdag/templates/etc/promtail/digdag.yaml

66 lines
1.4 KiB
YAML
Raw Normal View History

2020-09-07 13:38:14 +00:00
server:
disable: true
positions:
filename: /var/opt/promtail/promtail_digdag_position.yaml
clients:
- url: http://<%= @LOKIENDPOINT %>/loki/api/v1/push
scrape_configs:
- job_name: digdag
static_configs:
- targets:
- localhost
labels:
job: digdag
hostname: <%= @HOSTNAME %>
__path__: /var/log/supervisor/digdag.log
2020-10-24 03:44:17 +00:00
2020-09-07 13:38:14 +00:00
pipeline_stages:
- match:
2020-10-24 03:44:17 +00:00
selector: '{job="digdag"} |~ "^[0-9]+-[0-9]+-[0-9]+"'
2020-09-07 13:38:14 +00:00
stages:
- regex:
2020-10-24 03:44:17 +00:00
expression: '^(?P<datetime>\d+\-\d+\-\d+ \d+:\d+:\d+)([\.\d]+)? (?P<timezone>[\+\d]+) \[(?P<level>[^\]]+)\] (?P<message>.+)$'
- template:
source: timestamp
template: '{{ .datetime }} {{ .timezone }}'
2020-09-07 13:38:14 +00:00
- timestamp:
source: timestamp
format: 2006-01-02 15:04:05 -0700
- template:
source: level
2020-10-24 03:44:17 +00:00
template: '{{ if .level }}{{ .level }}{{ else }}notice{{ end }}'
2020-09-07 13:38:14 +00:00
- template:
source: level
2020-10-24 03:44:17 +00:00
template: '{{ ToLower .level }}'
2020-09-07 13:38:14 +00:00
- template:
2020-10-24 03:44:17 +00:00
source: level
template: '{{ regexReplaceAllLiteral "warn" .Value "warning" }}'
2020-09-07 13:38:14 +00:00
- labels:
level:
- output:
source: message
2020-10-24 03:44:17 +00:00
- match:
selector: '{job="digdag"} !~ "^[0-9]+-[0-9]+-[0-9]+"'
stages:
- template:
source: level
template: 'info'
- labels:
level: