-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfluentd.conf
81 lines (67 loc) · 1.61 KB
/
fluentd.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
# Do not collect fluentd's own logs to avoid infinite loops.
<match fluent.**>
@type null
</match>
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<source>
@type tail
format none
rotate_wait 60s
#path /mnt/logs/%Y/%m/%d/*.log
path "#{ENV['APPS_LOGS_LOG_PATTERN']}"
pos_file /mnt/buffers/mysql_slow_log.pos
read_from_head true
tag mysql.slowlog.db
format /(?:[^ ]*)? (?<server>[^ ]*)?\s+(?:[^ ]*:)?(\s*)(?<message>.+)$/
</source>
<match mysql.slowlog.* >
@type mysqlslowquerylog
add_tag_prefix cocatenated.
</match>
<filter **.*>
@type record_modifier
<record>
timestampFormated ${Time.at(record['timestamp'].to_s.slice(0,10).to_i, record['timestamp'].to_s.slice(0,10).to_i%1000).strftime('%Y-%m-%dT%H:%M:%S.%LZ')}
</record>
</filter>
<match *.**>
@type copy
<store>
@id forward_es
@type elasticsearch
hosts "#{ENV['ELS_HOST']}"
user "#{ENV['ELS_USER']}"
password "#{ENV['ELS_PWD']}"
reload_on_failure true
ssl_version TLSv1_2
scheme https
time_key timestampFormated
logstash_format true
logstash_prefix mysqlSlowQueries
request_timeout 15s
logstash_dateformat %Y%m%d
include_tag_key true
tag_key @log_name
ssl_verify false
type_name _doc
<buffer>
flush_mode interval
@type file
path /mnt/buffers/es-buffer/mysqlSlowQueries.*.buffer
flush_thread_count "#{ENV['FLUSH_THREAD_COUNT']}"
flush_interval 5s
chunk_limit_size 1M
overflow_action block
total_limit_size 4G
queued_chunks_limit_size 1000
</buffer>
</store>
#<store>
#@type stdout
#</store>
</match>
~