2017-05-07 4 views
0

出力ファイルをローカルに書き込むために、流暢な(0.12.35の)プラグインを使用しています。私の流暢な設定は次のようになります。Fluent out_file毎日1つの出力ファイルを作成するためのプラグイン

<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> 

これは〜10分ごとに複数のgzファイルを作成します。

-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 

私は毎日1つのgzippedファイルを作成する方法を知りたいと思います。設定してもtime_slice_waitから24hは役に立ちませんでした。

答えて

0

設定で愚かなことを逃した。 http://docs.fluentd.org/v0.12/articles/out_file#append

更新された構成

<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> 
関連する問題