为Fluentd文件configurationLogrotate。 必要?

我有以下fluent.conf

<source> type forward </source> <source> type monitor_agent port 24220 </source> # Listen DRb for debug <source> type debug_agent port 24230 </source> <source> type tail path /var/data/www/apps/app/logs/*.log pos_file /tmp/fluent.nginx.pos format syslog tag app.nginx-access # Regex fields format /^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*) "(?<referer>[^\"]*)" "(?<agent>[^\"]*)"$/ # Date and time format time_format %d/%b/%Y:%H:%M:%S %z </source> <match app.**> type copy <store> type file path /var/log/fluent/app </store> </match> 

是否有必要使用Logrotate @ /var/log/fluent/app/*还是将Fluent自己处理?

Fluentd的out_file插件会自动将输出文件分割一天,所以不需要使用logrotate。

如果要按不同的粒度进行分区,请更改“time_slice_format”参数(默认为%Y%m%d)。

但是,这意味着输出文件没有当前的规范名称。 为此,可以使用“buffer_type file”参数“symlink_path”。 这不是out_file本身的function, 而是任何缓冲的输出 。