itamae/cookbooks/prometheus/templates/etc/promtail/snmp_exporter.yaml

41 lines
973 B
YAML
Raw Normal View History

server:
disable: true
positions:
filename: /var/opt/promtail/promtail_snmp_exporter_position.yaml
clients:
- url: http://<%= @LOKIENDPOINT %>/loki/api/v1/push
scrape_configs:
- job_name: snmp_exporter
static_configs:
- targets:
- localhost
labels:
job: snmp_exporter
hostname: <%= @HOSTNAME %>
__path__: /var/log/supervisor/snmp_exporter.log
pipeline_stages:
- match:
selector: '{job="snmp_exporter"}'
stages:
- regex:
expression: '^level=(?P<level>[^ ]+) ts=(?P<timestamp>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z) (?P<message>.+)$'
- timestamp:
source: timestamp
format: 2006-01-02T15:04:05.000Z
location: Etc/GMT
- template:
source: level
template: '{{ regexReplaceAllLiteral "warn" .Value "warning" }}'
- labels:
level:
- output:
source: message