Hi Guys,
I tried to search the history but didn't find info on how to set multiple
template on an action, and the documentation doesn't say it here
https://www.rsyslog.com/how-to-bind-a-template/
template(name="OnlyMsg" type="string" string="%msg:::drop-last-lf%\n")
template(name="KubernetesLogFormat" type="string"
string="%msg:2:$%\n")
template(name="KubernetesLog" type="list") {
constant(value="/srv/log/")
property(name="hostname")
constant(value="/kubernetes/")
property(name="timegenerated" dateFormat="year")
constant(value="/")
property(name="$.logpath")
constant(value="/pods.log")
}
if $syslogfacility-text == 'local6' and $syslogseverity-text == 'info' and
$programname startswith 'k8s'
then {
-?KubernetesLog;KubernetesLogFormat
set $.logpath = replace($programname, "k8s__", "");
action(type="omfile" dynaFileCacheSize="1024"
*dynaFile="KubernetesLog");OnlyMsg;KubenetesLogFormat;KubernetesLog*
stop
}
How should i use 3 template?
Thanks!
Peter
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE
THAT.