diff --git a/homelab/server/config/monitoring/promtail-config.yml b/homelab/server/config/monitoring/promtail-config.yml index 36eeffd8..e530685f 100644 --- a/homelab/server/config/monitoring/promtail-config.yml +++ b/homelab/server/config/monitoring/promtail-config.yml @@ -29,6 +29,34 @@ scrape_configs: regex: '/(.*)' target_label: 'container' +# per: https://gist.github.com/ruanbekker/c6fa9bc6882e6f324b4319c5e3622460?permalink_comment_id=3764474 + - job_name: containers + entry_parser: raw + static_configs: + - targets: + - localhost + labels: + job: containerlogs + __path__: /var/lib/docker/containers/*/*log + pipeline_stages: + - json: + expressions: + stream: stream + attrs: attrs + tag: attrs.tag + - regex: + expression: (?P(?:[^|]*[^|])).(?P(?:[^|]*[^|])).(?P(?:[^|]*[^|])).(?P(?:[^|]*[^|])) + source: "tag" + - labels: + tag: + stream: + image_name: + container_name: + image_id: + container_id: + + + # local machine logs # #- job_name: local