Implement ruanbekker's job

This commit is contained in:
Joey Hafner 2022-07-08 01:27:27 -07:00
parent 1abf602e1c
commit 9a48e1349d

View File

@ -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<image_name>(?:[^|]*[^|])).(?P<container_name>(?:[^|]*[^|])).(?P<image_id>(?:[^|]*[^|])).(?P<container_id>(?:[^|]*[^|]))
source: "tag"
- labels:
tag:
stream:
image_name:
container_name:
image_id:
container_id:
# local machine logs
#
#- job_name: local