gpt4 book ai didi

timezone - 如何配置 Fluentd 的时区?

转载 作者:行者123 更新时间:2023-12-05 07:57:10 39 4
gpt4 key购买 nike

我的系统时间是:Tue Jan 6 09:44:49 CST 2015

td-agent.conf :

<match apache.access>
type webhdfs
host Page on test.com
port 50070
path /apache/%Y%m%d_%H/access.log.${hostname}
time_slice_format %Y%m%d
time_slice_wait 10m

time_format %Y-%m-%dT%H:%M:%S.%L%:z
timezone +08:00
flush_interval 1s
</match>

dir 的时间正好!

[hadoop@node1 ~]$ hadoop fs -ls /apache/20150106_09
Found 1 items
-rw-r--r-- 2 webuser supergroup 17496 2015-01-06 09:47 /apache/20150106_09/access.log.node1.Page on test.com

但是log的时间不对,不知道为什么?

2015-01-06T01:47:00.000+00:00   apache.access   {"host":"::1","user":null,"method":"GET","path":"/06","code":404,"size":275,"referer":null,"agent":"ApacheBench/2.3"}
20

最佳答案

我的配置没问题。

    type webhdfs
host 192.168.80.41
port 50070
path /log/fluent_%Y%m%d_%H.log
time_format %Y-%m-%d %H:%M:%S
localtime
flush_interval 10s

在配置中添加本地时间

关于timezone - 如何配置 Fluentd 的时区?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27791188/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com