0

我使用以下配置在 ubuntu 14.04 上运行 td-agent:


    <source>
     type tail
     format json
     path /path/tomcat/logs/file-input.log
     tag bhc.hdfs
     pos_file /var/td-agent/file.pos
     </source>

    <match bhc.hdfs>
     type webhdfs
     port 50070
     host my.host.name
     path /hdfs/path/file.${hostname}.%Y%m%d.log
     username user
     flush_interval 10s
     output_include_time false
     output_include_tag false
     output_data_type json
    </match>

目录/path/tomcat/logs/file-input.log中的日志源文件仅包含结构化的 json 数据。Ntp 守护程序已安装并正在运行,但是当 td-agent 在 hdfs 中创建文件时,文件名的日期为 19700101。出了什么问题?

4

1 回答 1

1

Fluentd 记录有时间,webhdfs 插件使用该记录的时间戳创建文件,而不是当前时间。

tail插件默认使用名为time记录时间的字段。如果您的日志数据有任何其他时间信息字段,您可以使用time_key和指定它time_format

另见:http ://docs.fluentd.org/articles/in_tail

于 2015-03-12T01:49:47.250 回答