forked from markvnext/docker-fluentd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfluent.conf
73 lines (60 loc) · 1.56 KB
/
fluent.conf
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
<source>
type docker_metrics
cgroup_path /mnt/cgroup
stats_interval 1m
tag_prefix docker.stats
time_format %Y-%m-%dT%H:%M:%S
format json
</source>
<source>
type tail
path /var/lib/docker/containers/*/*-json.log
pos_file /var/lib/docker/containers/containers.log.pos
tag docker.log.*
time_format %Y-%m-%dT%H:%M:%S
format json
</source>
<match docker.log.**>
type docker_tag_resolver
# tags as docker.container.*
</match>
<match docker.container.**>
type record_reformer
tag processed.docker.container.*
<record>
timestamp #{time} # capture timestamp, avoid overwriting by later fluentd instance
source "application" # use this to group container logs together
host "#{ENV['HOST']}"
short_id ${hostname}
long_id ${tag_parts[-1]}
image ${tag_parts[2]}
name ${tag_parts[-2]}
message ${log}
</record>
remove_keys log
</match>
<match docker.log.**>
type docker_tag_resolver
</match>
<match docker.stats.**>
type record_reformer
tag processed.docker.container.*
<record>
timestamp #{time} # capture timestamp, avoid overwriting by later fluentd instance
source "system" # use this to group container logs together
host "#{ENV['HOST']}"
short_id ${hostname}
long_id ${id}
</record>
remove_keys id,hostname
</match>
<match processed.docker.container.**>
type secure_forward # username/password, and/or SSL certs can be configure here
shared_key secret_string
self_hostname server.fqdn.local
<server>
host "#{ENV['FLUENTD_METERING_IP']}"
# port 24284
</server>
format json
</match>