you can create as many templates as you want.
You can use a different template for each output (as well as for the filename
for files) and with v8.x you can even use formats to assign values to variables
that you can then use in conditional tests and other formats.
David Lang
On Mon, 2 Feb 2015, Xavier Fustero wrote:
Excellent Tait!
I didn't know you can create two templates: one for the DynaFile and
another for the format!
Thanks!
template(name="
TraditionalFormatWithPRI" type="string"
string="%pri-text%: %timestamp% %HOSTNAME%
%syslogtag%%msg:::drop-last-lf%\n")
action(type="omfile" DynaFile="rails_app"
Template="TraditionalFormatWithPRI")
On 2 February 2015 at 16:30, Tait Clarridge <[email protected]> wrote:
On Mon, Feb 2, 2015 at 10:01 AM, Xavier Fustero <[email protected]>
wrote:
Replying myself....
It seems you need to redefine the generic template in the rsyslog.conf
adding these pri-text:
$template TraditionalFormatWithPRI,"%pri-text%: %timestamp% %HOSTNAME%
%syslogtag%%msg:::drop-last-lf%\n"
$ActionFileDefaultTemplate TraditionalFormatWithPRI
Now it works!
Xavi
You can also specify a template for the output for specific actions.
eg.
template(name="TraditionalFormatWithPRI" type="string"
string="%pri-text%: %timestamp% %HOSTNAME%
%syslogtag%%msg:::drop-last-lf%\n")
action(type="omfile" DynaFile="rails_app"
Template="TraditionalFormatWithPRI")
That way you don't have to override the default template.
Tait
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.