Configuration

global:
  file_watch_config:
    min_poll_frequency: 250ms
    max_poll_frequency: 250ms
server:
  http_listen_network: tcp
  http_listen_address: ""
  http_listen_port: 9080
  http_listen_conn_limit: 0
  grpc_listen_network: tcp
  grpc_listen_address: ""
  grpc_listen_port: 0
  grpc_listen_conn_limit: 0
  proxy_protocol_enabled: false
  tls_cipher_suites: ""
  tls_min_version: ""
  http_tls_config:
    cert: ""
    key: null
    client_ca: ""
    cert_file: ""
    key_file: ""
    client_auth_type: ""
    client_ca_file: ""
  grpc_tls_config:
    cert: ""
    key: null
    client_ca: ""
    cert_file: ""
    key_file: ""
    client_auth_type: ""
    client_ca_file: ""
  register_instrumentation: true
  report_grpc_codes_in_instrumentation_label_enabled: false
  graceful_shutdown_timeout: 30s
  http_server_read_timeout: 30s
  http_server_read_header_timeout: 0s
  http_server_write_timeout: 30s
  http_server_idle_timeout: 2m0s
  http_log_closed_connections_without_response_enabled: false
  grpc_server_max_recv_msg_size: 4194304
  grpc_server_max_send_msg_size: 4194304
  grpc_server_max_concurrent_streams: 100
  grpc_server_max_connection_idle: 2562047h47m16.854775807s
  grpc_server_max_connection_age: 2562047h47m16.854775807s
  grpc_server_max_connection_age_grace: 2562047h47m16.854775807s
  grpc_server_keepalive_time: 2h0m0s
  grpc_server_keepalive_timeout: 20s
  grpc_server_min_time_between_pings: 5m0s
  grpc_server_ping_without_stream_allowed: false
  grpc_server_num_workers: 0
  grpc_server_stats_tracking_enabled: true
  grpc_server_recv_buffer_pools_enabled: false
  log_format: logfmt
  log_level: info
  log_source_ips_enabled: false
  log_source_ips_full: false
  log_source_ips_header: ""
  log_source_ips_regex: ""
  log_request_headers: false
  log_request_at_info_level_enabled: false
  log_request_exclude_headers_list: ""
  http_path_prefix: ""
  cluster_validation:
    label: ""
    grpc:
      enabled: false
      soft_validation: false
  external_url: ""
  health_check_target: null
  disable: false
  profiling_enabled: false
  enable_runtime_reload: false
client:
  url: ""
  batchwait: 1s
  batchsize: 1048576
  follow_redirects: false
  enable_http2: false
  backoff_config:
    min_period: 500ms
    max_period: 5m0s
    max_retries: 10
  timeout: 10s
  tenant_id: ""
  drop_rate_limited_batches: false
clients:
- url: http://loki-main:3100/loki/api/v1/push
  batchwait: 1s
  batchsize: 1048576
  follow_redirects: true
  enable_http2: true
  backoff_config:
    min_period: 500ms
    max_period: 5m0s
    max_retries: 10
  timeout: 10s
  tenant_id: ""
  drop_rate_limited_batches: false
positions:
  sync_period: 10s
  filename: /tmp/positions.yaml
  ignore_invalid_yaml: false
scrape_configs:
- job_name: proxmox-system
  pipeline_stages:
  - match:
      selector: '{job="proxmox-system"} |~ "proxmox-metrics"'
      stages:
      - regex:
          expression: '.*proxmox-metrics: (?P<metric_name>[^=]+)=(?P<metric_value>[^
            ]+)'
      - labels:
          log_type: metrics
          metric_name: null
          metric_value: null
  - match:
      selector: '{job="proxmox-system"} |~ "ubuntu-metrics"'
      stages:
      - regex:
          expression: .*ubuntu-metrics (?P<metric_name>[^=]+)=(?P<metric_value>[^
            ]+)
      - labels:
          log_type: ubuntu-metrics
          metric_name: null
          metric_value: null
      - match:
          selector: '{job="proxmox-system", log_type="ubuntu-metrics"} |~ "gpu_id="'
          stages:
          - regex:
              expression: .* gpu_id=(?P<gpu_id>[^ ]+)
          - labels:
              gpu_id: null
      - match:
          selector: '{job="proxmox-system", log_type="ubuntu-metrics"} |~ "interface="'
          stages:
          - regex:
              expression: .* interface=(?P<interface>[^ ]+)
          - labels:
              interface: null
  - match:
      selector: '{job="proxmox-system"} |~ "pve"'
      stages:
      - regex:
          expression: '.* (?P<pve_service>pve[a-zA-Z-]*): (?P<message>.*)'
      - labels:
          log_type: pve
          pve_service: null
  static_configs:
  - targets:
    - localhost
    labels:
      __path__: /host/var/log/syslog
      host: proxmox-main
      job: proxmox-system
- job_name: plg-docker
  relabel_configs:
  - source_labels: [__meta_docker_container_name]
    separator: ;
    target_label: container
    replacement: $1
    action: replace
  - source_labels: [__meta_docker_container_label_com_docker_compose_service]
    separator: ;
    target_label: service
    replacement: $1
    action: replace
  - separator: ;
    target_label: job
    replacement: plg-stack
    action: replace
  docker_sd_configs:
  - follow_redirects: true
    enable_http2: true
    host: unix:///var/run/docker.sock
    port: 80
    filters: []
    host_networking_host: localhost
    refresh_interval: 30s
    match_first_network: true
  static_configs: []
- job_name: openwrt-direct
  pipeline_stages:
  - match:
      selector: '{__syslog_message_hostname=~".*openwrt.*|.*router.*"}'
      stages:
      - labels:
          device_type: router
      - match:
          selector: '{__syslog_message_app_name="kernel"} |~ "(DROP|REJECT|ACCEPT)"'
          stages:
          - regex:
              expression: .*(DROP|REJECT|ACCEPT).*SRC=(?P<src_ip>\S+).*DST=(?P<dst_ip>\S+).*PROTO=(?P<protocol>\S+).*SPT=(?P<src_port>\d+).*DPT=(?P<dst_port>\d+)
          - labels:
              dst_ip: null
              dst_port: null
              log_type: firewall
              protocol: null
              src_ip: null
              src_port: null
      - match:
          selector: '{__syslog_message_app_name="dnsmasq"} |~ "query"'
          stages:
          - regex:
              expression: .*query\[(?P<query_type>\w+)\] (?P<domain>\S+) from (?P<client_ip>\d+\.\d+\.\d+\.\d+)
          - labels:
              client_ip: null
              domain: null
              log_type: dns
              query_type: null
  syslog:
    listen_address: 0.0.0.0:5140
    listen_protocol: udp
    idle_timeout: 1m0s
    label_structured_data: false
    labels:
      job: openwrt-direct
      receiver: proxmox
    use_incoming_timestamp: true
    use_rfc5424_message: false
    syslog_format: rfc5424
    max_message_length: 8192
  relabel_configs:
  - source_labels: [__syslog_message_hostname]
    separator: ;
    target_label: host
    replacement: $1
    action: replace
  - source_labels: [__syslog_message_app_name]
    separator: ;
    target_label: app
    replacement: $1
    action: replace
  - source_labels: [__syslog_message_severity]
    separator: ;
    target_label: severity
    replacement: $1
    action: replace
  static_configs: []
- job_name: from-rsyslog
  syslog:
    listen_address: 0.0.0.0:1514
    listen_protocol: tcp
    idle_timeout: 1m0s
    label_structured_data: false
    labels:
      job: from-rsyslog
      receiver: proxmox
    use_incoming_timestamp: true
    use_rfc5424_message: false
    syslog_format: rfc5424
    max_message_length: 8192
  relabel_configs:
  - source_labels: [__syslog_message_hostname]
    separator: ;
    target_label: host
    replacement: $1
    action: replace
  - source_labels: [__syslog_message_app_name]
    separator: ;
    target_label: app
    replacement: $1
    action: replace
  - source_labels: [__syslog_message_severity]
    separator: ;
    target_label: severity
    replacement: $1
    action: replace
  static_configs: []
- job_name: openwrt-remote-http
  pipeline_stages:
  - regex:
      expression: ^(?P<timestamp>\w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2})\s+(?P<hostname>\S+)\s+(?P<service_name>\S+?)(?:\[(?P<pid>\d+)\])?\s*:\s*(?P<message>.*)
  - labels:
      hostname: null
      service_name: null
  - match:
      selector: '{job="openwrt-remote-http"} |~ "(DROP|REJECT|ACCEPT)"'
      stages:
      - regex:
          expression: .*(DROP|REJECT|ACCEPT).*SRC=(?P<src_ip>\S+).*DST=(?P<dst_ip>\S+).*PROTO=(?P<protocol>\S+).*SPT=(?P<src_port>\d+).*DPT=(?P<dst_port>\d+)
      - labels:
          dst_ip: null
          dst_port: null
          log_type: firewall
          protocol: null
          src_ip: null
          src_port: null
  - match:
      selector: '{job="openwrt-remote-http",service_name="dnsmasq"} |~ "query"'
      stages:
      - regex:
          expression: .*query\[(?P<query_type>\w+)\] (?P<domain>\S+) from (?P<client_ip>\d+\.\d+\.\d+\.\d+)
      - labels:
          client_ip: null
          domain: null
          log_type: dns
          query_type: null
  - match:
      selector: '{job="openwrt-remote-http",service_name="hostapd"} |~ "(CONNECTED|DISCONNECTED)"'
      stages:
      - regex:
          expression: .*(?P<wifi_action>AP-STA-(?:CONNECTED|DISCONNECTED))\s+(?P<mac_address>[0-9a-f:]{17})
      - labels:
          log_type: wifi
          mac_address: null
          wifi_action: null
  static_configs:
  - targets:
    - localhost
    labels:
      __path__: /tmp/openwrt-remote-logs/OpenWrt-Remote.log
      device_type: router
      host: OpenWrt-Remote
      job: openwrt-remote-http
      log_source: http
- job_name: ubuntu-server-http
  pipeline_stages:
  - regex:
      expression: ^(?P<timestamp>\w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2})\s+(?P<hostname>\S+)\s+(?P<service_name>\S+?)(\s|$)(?P<message>.*)
  - labels:
      hostname: null
      service_name: null
  - match:
      selector: '{job="ubuntu-server-http"} |~ "ubuntu-metrics"'
      stages:
      - regex:
          expression: .*ubuntu-metrics (?P<metric_name>[^=]+)=(?P<metric_value>[^
            ]+).*
      - labels:
          log_type: ubuntu-metrics
          metric_name: null
          metric_value: null
      - match:
          selector: '{job="ubuntu-server-http", log_type="ubuntu-metrics"} |~ "gpu_id="'
          stages:
          - regex:
              expression: .* gpu_id=(?P<gpu_id>[^ ]+)
          - labels:
              gpu_id: null
      - match:
          selector: '{job="ubuntu-server-http", log_type="ubuntu-metrics"} |~ "gpu_name="'
          stages:
          - regex:
              expression: .* gpu_name=(?P<gpu_name>[^ ]+)
          - labels:
              gpu_name: null
      - match:
          selector: '{job="ubuntu-server-http", log_type="ubuntu-metrics"} |~ "interface="'
          stages:
          - regex:
              expression: .* interface=(?P<interface>[^ ]+)
          - labels:
              interface: null
      - match:
          selector: '{job="ubuntu-server-http", log_type="ubuntu-metrics"} |~ "disk="'
          stages:
          - regex:
              expression: .* disk=(?P<disk>[^ ]+)
          - labels:
              disk: null
  static_configs:
  - targets:
    - localhost
    labels:
      __path__: /tmp/openwrt-remote-logs/Ubuntu-Server.log
      device_type: server
      host: valalav-B650-AORUS-ELITE-AX
      job: ubuntu-server-http
      log_source: http
target_config:
  sync_period: 10s
  stdin: false
limits_config:
  readline_rate: 10000
  readline_burst: 10000
  readline_rate_drop: true
  max_streams: 0
  max_line_size: 0B
  max_line_size_truncate: false
tracing:
  enabled: true
  profiling_enabled: true
wal:
  enabled: false
  dir: ""
  cleanSegmentsOlderThan: 0s
  watchConfig:
    minReadFrequency: 0s
    maxReadFrequency: 0s