21 Oct
2016
21 Oct
'16
10:20
On 2016-10-20 22:37, Carlos E. R. wrote:
How could I log a timestamp written by the rsyslog server machine?
Solved, thanks to an offlist reply. I need %timegenerated%. In this case: $template My_SyslogProtocolExt,"<%SYSLOGFACILITY%.%SYSLOGPRIORITY%> %timegenerated:::date-rfc3339% %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n" if ($source == 'router') then \ -/var/log/router;My_SyslogProtocolExt & stop So I get entries like this: <1.6> 2016-10-21T12:13:22.049600+02:00 2016-08-01T02:00:09+02:00 ap.valinor kernel - - - br0: port 2(eth1) entering forwarding state -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)