-
Notifications
You must be signed in to change notification settings - Fork 0
/
fluent.conf
83 lines (74 loc) · 1.88 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
72
73
74
75
76
77
78
79
80
81
82
83
<source>
@type pipe
path /log/php-error.log
multiline_flush_interval 2s
emit_unmatched_lines true
format multiline
format_firstline /^\[\d{2}-\w{3}-\d{4}\s+\d{2}:\d{2}:\d{2}\s\w+\/\w+\]/
format1 /^\[(?<time>\d{2}-\w{3}-\d{4}\s+\d{2}:\d{2}:\d{2}\s\w+\/\w+)\] PHP (?<severity>[^:]+):\s?+(?<msg>.*)/
time_format %d-%b-%Y %H:%M:%S %Z
tag php.error
</source>
<source>
@type pipe
path /log/fpm-error.log
multiline_flush_interval 2s
emit_unmatched_lines true
format multiline
format_firstline /^\[\d{2}-\w{3}-\d{4}\s+\d{2}:\d{2}:\d{2}(.?\d+)?\]/
format1 /^\[(?<timestamp>\d{2}-\w{3}-\d{4}\s+\d{2}:\d{2}:\d{2}(.?\d+)?\]) (?<msg>.*)/
time_format %d-%b-%Y %H:%M:%S
tag php.fpm-error
</source>
<source>
@type pipe
path /log/slow.log
multiline_flush_interval 2s
emit_unmatched_lines true
format multiline
format_firstline /^\[\d{2}-\w{3}-\d{4}\s+\d{2}:\d{2}:\d{2}\]/
format1 /^\[(?<time>\d{2}-\w{3}-\d{4}\s+\d{2}:\d{2}:\d{2})\]\s+\[pool\s+(?<pool>\w+)\]\s+pid\s+(?<pid>\d+)\s?(?<msg>.*)/
time_format %d-%b-%Y %H:%M:%S
tag php.slowlog
</source>
<source>
@type pipe
path /log/app-error.json
format none
tag php.app-errors
</source>
<source>
@type pipe
path /log/app-access.json
format none
tag php.app-access
</source>
<filter php.error>
@type map
time time
# TODO install ruby to use `record["msg"].strip` & `record["severity"].upcase`.
record ({"php_error_log" => {"error" => record["msg"], "level" => record["severity"]}})
</filter>
<filter php.app-*>
@type parser
format json
key_name message
</filter>
<filter php.*>
@type record_transformer
<record>
hostname "#{Socket.gethostname}"
event_type ${tag}
team "#{ENV['TEAM']}"
application "#{ENV['APPLICATION']}"
</record>
</filter>
# this must be the latest filter
<filter php.*>
@type stdout
include_time_key true
format json
</filter>
<match **>
@type null
</match>