-
Notifications
You must be signed in to change notification settings - Fork 0
/
promtail.yml
49 lines (45 loc) · 1.16 KB
/
promtail.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://loki:3100/loki/api/v1/push
scrape_configs:
- 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
log: log
- 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:
- json:
expressions:
log: log
source: "log"
- regex:
expression: "^(?P<time_local>[^ ]*)\\t(?P<level>[^ ]*)\\t(?P<function>[^ ]*)\\t(?P<message>.*)\\n"
source: "log"
- labels:
time_local:
level:
function:
message: