I allready have template in rsyslog.conf file changing directory to store log files but now we must add year to every log msg in this file.
$template TmplAuth, "/home/someuser/logs/%HOSTNAME%/%HOSTNAME%.log"
*.* ?TmplAuth
I do have line that is adding year to every message and it works:
$template TmplAuth,"%$Year% %timegenerated% %syslogtag%%msg:::drop-last-lf%\n"
but how can I use both options (changing log path and adding year to every message in log file) together in single template - is it possible ?
If you know solution please let me know.
Thank you in advance.
You cannot do this inside a template, but inside the action:
and in obsolete legacy format you could use:
Full details can be found in the omfile documentation.