-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpromtail-config-docker.yaml
122 lines (107 loc) · 2.75 KB
/
promtail-config-docker.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: ./mnt/var/positions-docker.yaml
#
# Where to send logs.
#
clients:
- url: http://loki:3100/loki/api/v1/push
external_labels:
host: docker
#
# What to read.
#
scrape_configs:
- job_name: varlog
static_configs:
- targets:
- localhost
labels:
job: varlogs
#
# Note that on Macs, this won't pull in anything...
#
__path__: /var/log/*.log
- job_name: synthetic
static_configs:
- targets:
- localhost
labels:
job: logs-synthetic
__path__: /logs/synthetic/*.log
pipeline_stages:
- match:
selector: '{job="logs-synthetic"}'
stages:
- regex:
expression: '(?P<timestamp>(\w+ \w+ +\d+ \d{2}:\d{2}:\d{2} \w+ \d{4})) (?P<hostname>\w+)'
#
# We can uncomment these to have more labels, but be advised that unique streams are based
# on labels, and a high cardinality means that we'll get "HTTP 429 Too Many Connections" errors.
#
# Fewer labels == better performance
#
#- regex:
# expression: 'count=(?P<count>(\d+))'
#- regex:
# expression: 'count2=(?P<count2>(\d+))'
#- regex:
# expression: 'count3=(?P<count3>(\d+))'
- labels:
hostname: hostname
#count: count
#count2: count2
#count3: count3
#test_timestamp: timestamp
- timestamp:
format: UnixDate
source: timestamp
- job_name: ping
static_configs:
- targets:
- localhost
labels:
job: logs-ping
__path__: /logs/ping/*.log
pipeline_stages:
- match:
selector: '{job="logs-ping"}'
stages:
- regex:
expression: '(?P<timestamp>(\d+-\d+-\d+ \d+:\d+:\d+\.\d+))'
- regex:
expression: 'target=(?P<target>([^ ]+)) '
- labels:
target: target
- timestamp:
source: timestamp
#
# This is a custom format
#
format: "2006-01-02 15:04:05.999999999"
- job_name: septa
static_configs:
- targets:
- localhost
labels:
job: logs-septa
__path__: /logs/septa/*.log
pipeline_stages:
- match:
selector: '{job="logs-septa"}'
stages:
- regex:
expression: '(?P<timestamp>(\d{4}\d{2}\d{2}T\d{2}\d{2}\d{2}))'
- regex:
expression: '"line": "(?P<line>[^"]+)"'
- labels:
#test_timestamp: timestamp
line: line
- timestamp:
source: timestamp
#
# This is a custom format
#
format: "20060102T15040"