Hi,
Not sure if this is a bug, or an error in configuration on my part. Let me know if I should open an issue on github instead.
fluentd version: v0.12
Environment information: Docker FROM fluent/fluentd:v0.12-debian
Problem explanation:
Timestamp in the message at various levels:
rsyslog (using template RSYSLOG_ForwardFormat) in /var/log/syslog:
2017-02-15T10:36:47.257774+02:00 pi01 pi: SysTime is: Wed Feb 15 10:36:47 EET 2017
fluentd (out_stdout):
2017-02-15 10:36:47 +0000 syslog.user.notice: {"host":"pi01","ident":"pi","message":"SysTime is: Wed Feb 15 10:36:47 EET 2017"}
The timezone suffix is reset to +0000 when using the config below, and so when elasticsearch plugin sets the unix epoch time as the @timestamp field, it's +0200 hours ahead of actual time that the log was generated.
For what it's worth, the machine running rsyslog and the docker host were on two different time zones, as the docker container was not explicitly set a timezone, and it defaulted to UTC.
# fluentd/conf/fluent.conf
<source>
@type forward
port 24224
bind 0.0.0.0
tag docker
</source>
<source>
@type syslog
port 5140
bind 0.0.0.0
tag syslog
</source>
<match **>
@type copy
<store>
@type stdout
</store>
<store>
@type elasticsearch
host elasticsearch
port 9200
logstash_format true
logstash_prefix fluentd
logstash_dateformat %Y%m%d
include_tag_key true
type_name fluentd
tag_key @log_name
flush_interval 1s
</store>
</match>