Fluent out_file plugin to create single output file for each day
fluent
Solution
Missed a silly thing in configuration: https://docs.fluentd.org/output/file#append
Updated configuration
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<source>
@type http
port 8888
bind 0.0.0.0
body_size_limit 32m
keepalive_timeout 10s
</source>
<match **>
type file
path /var/log/test/logs
format json
time_slice_format %Y%m%d
time_slice_wait 24h
compress gzip
include_tag_key true
utc
buffer_path /var/log/test/logs.*
append true
</match>
Problem
I'm using out_file plugin of fluent (version 0.12.35) to write output to file locally. My fluent config looks like : ``` <source> @type forward port 24224 bind 0.0.0.0 </source> <source> @type http port 8888 bind 0.0.0.0 body_size_limit 32m keepalive_timeout 10s </source> <match **> type file path /var/log/test/logs format json time_slice_format %Y%m%d time_slice_wait 24h compress gzip include_tag_key true utc buffer_path /var/log/test/logs.* </match> ``` This creates multiple gz file for every ~10min. ``` -rw-r--r-- 1 root root 256546 May 6 07:03 logs.20170506_0.log.gz -rw-r--r-- 1 root root 260730 May 6 07:14 logs.20170506_1.log.gz -rw-r--r-- 1 root root 261155 May 6 07:25 logs.20170506_2.log.gz -rw-r--r-- 1 root root 258903 May 6 08:56 logs.20170506_10.log.gz -rw-r--r-- 1 root root 282680 May 6 09:08 logs.20170506_11.log.gz ... -rw-r--r-- 1 root root 261973 May 6 10:44 logs.20170506_19.log.gz ``` I want to know the way to create a single gzipped file for each day. Even setting `time_slice_wait` to `24h` didn't help.