2017-05-07 1 views
0

출력물을 로컬 파일에 쓰려면 out_file 플러그인 (0.12.35 버전)을 사용하고 있습니다. 유창한 설정은 다음과 같습니다 :Fluent out_file 매일 매일 하나의 출력 파일을 만드는 플러그인

<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 

매일 하나의 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> 
관련 문제