Open ptrovatelli opened 2 years ago
@joker1007 what's your take on this?
@cosmo0920 what do you think?
we are willing to do the change in the code. will you merge it then?
a change will be required in https://github.com/reproio/remote_syslog_sender too. we can do both.
thanks
Hello, We're using fluentd td-agent to get logs from linux servers (/var/log/secure) and send them to a remote destination using https://github.com/reproio/remote_syslog_sender and https://github.com/eric/syslog_protocol
We would like to keep the original log timestamp in place of the syslog message timestamp when sending the syslog message to the destination. However, it seems that the original log timestamp is overwritten by Time.now = the time when the packet is sent.
We're using TCP and syslog RFC 3164
This is and extract of our td-agent configuration:
Example log file:
We have captured the network packet produced by the plugin: we can see that the syslog timestamp is equal to the time of packet sending (11:49:47 truncated at the second) instead of the original log timestamp (11:48:40)
What we see:
We would like to have the original log timestamp here, as parsed by the td-agent configuration "time" variable.
I believe that https://github.com/eric/syslog_protocol supports it: here it is getting the timestamp from the message and putting Time.now only if time is not found or PRI in incorrect:
https://github.com/eric/syslog_protocol/blob/master/lib/syslog_protocol/parser.rb#L9
Thanks!