forked from oakestra/oakestra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
promtail.yml
54 lines (42 loc) · 1.37 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
50
51
52
# Further configuration options are available at:
# https://grafana.com/docs/loki/latest/clients/promtail/configuration/
server:
http_listen_port: 9080
grpc_listen_port: 0
enable_runtime_reload: true
positions:
filename: /tmp/positions.yaml
clients:
- url: http://cluster_loki:3101/loki/api/v1/push
scrape_configs:
- job_name: root_logs_scraper
docker_sd_configs:
- host: unix:///var/run/docker.sock
refresh_interval: 5s
filters:
- name: label
values: ["logging=cluster_promtail"]
relabel_configs:
- source_labels: ['__meta_docker_container_id']
target_label: 'container_id'
- source_labels: ['__meta_docker_network_ip']
target_label: 'container_ip'
- source_labels: ['__meta_docker_container_name']
regex: '/(.*)'
target_label: 'container_name'
- source_labels: ['__meta_docker_container_log_stream']
target_label: 'logstream'
- source_labels: ['__meta_docker_container_label_logging_jobname']
target_label: 'job'
pipeline_stages:
- json:
expressions:
level: level
service: service
filename: filename
- regex: #Regex for `default` logging format
expression: '(?P<level>[^\[\]]+?)(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (?P<service>[^:]+) (?P<file>[^:]+):(?P<line>\d+)\] (?P<message>.+)'
- labels:
level: level
service: service
file: line