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: - match: selector: '{job="digdag"} !~ "^[0-9]{4}-[0-9]{2}-[0-9]{2}"' 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"' 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"' stages: - regex: expression: '^(?P\d+\-\d+\-\d+ \d+:\d+:\d+)([\.\d]+)? (?P[\+\d]+) \[(?P[^\]]+)\] (?P.+)$' - template: source: timestamp template: '{{ .datetime }} {{ .timezone }}' - timestamp: source: timestamp format: 2006-01-02 15:04:05 -0700 - template: source: level template: '{{ if .level }}{{ .level }}{{ else }}notice{{ end }}' - template: source: level template: '{{ ToLower .level }}' - template: source: level template: '{{ regexReplaceAllLiteral "warn" .Value "warning" }}' - labels: level: - output: source: message