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
|
|
|
|
|
|
|
|
pipeline_stages:
|
2020-11-14 03:33:43 +00:00
|
|
|
- match:
|
2020-12-06 03:28:48 +00:00
|
|
|
selector: '{job="digdag"} !~ "^[0-9]{4}-[0-9]{2}-[0-9]{2}"'
|
2020-11-14 03:33:43 +00:00
|
|
|
action: drop
|
|
|
|
|
2020-09-07 13:38:14 +00:00
|
|
|
- match:
|
2020-12-06 03:28:23 +00:00
|
|
|
selector: '{job="digdag"} |~ "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} ERROR"'
|
|
|
|
action: drop
|
|
|
|
|
|
|
|
- match:
|
|
|
|
selector: '{job="digdag"} !~ "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} ERROR"'
|
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
|