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
|
[INPUT]
Name tail
Path /var/log/containers/*.log
Exclude_Path /var/log/containers/fluent*.log
Parser crid
Tag kube.*
Mem_Buf_Limit 5MB
Skip_Long_Lines On
[FILTER]
Name kubernetes
Match kube.*
Merge_Log On
Keep_Log Off
K8S-Logging.Parser On
K8S-Logging.Exclude On
[OUTPUT]
Name gelf
Match kube.*
Host 128.0.255.10
Port 12203
Mode udp
Gelf_Short_Message_Key message
Gelf_Full_Message_Key message
Compress false
[PARSER]
Name crid
Format regex
Regex ^(?<time>[^ ]+) (?<host>stdout|stderr) (?<logtag>[^ ]*) (?<message>.*)$
Time_Keep Off
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.000
# 因为GELF日志格式的时间是保留后三位,因此后面多加000,否则不展示日志
|