rsyslog - receive logs in UTC only

Latest response

Yet another rsyslog question.

rsyslog-8.24 running on an RHEL7.7 box which is in UTC. We have clients machines at different time zones. Now the logs from clients coming with the client machine time stamp. I want to change the behavior - all the logs received by the rsyslog server should be with UTC timestamp.

I read about the date.inUTC parameter, but not found good example how to use it in the configuration file.


This can be done in better ways.... But below configurations worked for me.
template(name="DynFileServer" type="string" string="/var/log/remote/%$YEAR%-%$MONTH%-%$DAY%/%HOSTNAME%")
$template myFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg%\n"
           $ActionFileDefaultTemplate myFormat
          action(type="omfile" dynaFile="DynFileServer"  dirCreateMode="0755")
input(type="imtcp" port="5000" ruleset="Rule-Servers")
input(type="imudp" port="5000" ruleset="Rule-Servers")