server:
  http_listen_port: 9080
  log_level: warn

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://xpeditis-loki:3100/loki/api/v1/push
    batchwait: 1s
    batchsize: 1048576
    timeout: 10s

scrape_configs:
  - job_name: docker
    docker_sd_configs:
      - host: unix:///var/run/docker.sock
        refresh_interval: 5s
        filters:
          - name: label
            values: ['logging=promtail']

    relabel_configs:
      - source_labels: ['__meta_docker_container_label_logging_service']
        target_label: service
      - source_labels: ['__meta_docker_container_name']
        regex: '/?(.*)'
        replacement: '${1}'
        target_label: container
      - source_labels: ['__meta_docker_container_log_stream']
        target_label: stream

    pipeline_stages:
      - drop:
          older_than: 15m
          drop_counter_reason: entry_too_old

      - drop:
          expression: 'GET /(health|metrics|minio/health)'

      - json:
          expressions:
            level: level
            msg: msg
            context: context
            reqId: reqId

      - labels:
          level:
          context:

      - template:
          source: level
          template: >-
            {{ if eq .Value "10" }}trace{{ else if eq .Value "20" }}debug{{ else if eq .Value "30" }}info{{ else if eq .Value "40" }}warn{{ else if eq .Value "50" }}error{{ else if eq .Value "60" }}fatal{{ else }}{{ .Value }}{{ end }}

      - labels:
          level:
