Mailing List Archive

How to combine template and outchannel together in rsyslog.conf?
i am try to play with rsyslog configuration. To my knowledge

To enable log rotation: we should do something below:

$outchannel log_rotation,/var/log/syslog.log, 1048576 ,/usr/bin/rotate.sh
*.* :omfile:$log_rotation
And to tabulate syslog with a template : we should do something like this:

$template CSVData, "%timereported:::date-rfc3339%,\
%hostname%,\
%syslogfacility-text%,\
%syslogpriority-text%,\
%app-name:::csv%,\
%msg:::drop-last-lf,csv%\n"

*.* /var/log/syslog.log;CSVData
May i know how to combine these two together? My intention is to tabulate a
syslog with my template and have it rotate when the log is exceed 1MB.

At first i thought of

$outchannel log_rotation,/var/log/syslog.log;CSVData, 1048576
,/usr/bin/rotate.sh
*.* :omfile:$log_rotation
But it not working, it just generate file known as syslog.log;CSVData



--
Sent from: http://rsyslog-users.1305293.n2.nabble.com/
_______________________________________________
rsyslog mailing list
https://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.
Re: How to combine template and outchannel together in rsyslog.conf? [ In reply to ]
I would suggest that you switch to the new action() syntax first as that will
make it much clearer as to what exactly is happening.

David Lang

On Wed, 21 Oct 2020, kjlau0112 via rsyslog wrote:

> Date: Wed, 21 Oct 2020 02:30:44 -0700 (MST)
> From: kjlau0112 via rsyslog <rsyslog@lists.adiscon.com>
> To: rsyslog@lists.adiscon.com
> Cc: kjlau0112 <lkarnjye@gmail.com>
> Subject: [rsyslog] How to combine template and outchannel together in
> rsyslog.conf?
>
> i am try to play with rsyslog configuration. To my knowledge
>
> To enable log rotation: we should do something below:
>
> $outchannel log_rotation,/var/log/syslog.log, 1048576 ,/usr/bin/rotate.sh
> *.* :omfile:$log_rotation
> And to tabulate syslog with a template : we should do something like this:
>
> $template CSVData, "%timereported:::date-rfc3339%,\
> %hostname%,\
> %syslogfacility-text%,\
> %syslogpriority-text%,\
> %app-name:::csv%,\
> %msg:::drop-last-lf,csv%\n"
>
> *.* /var/log/syslog.log;CSVData
> May i know how to combine these two together? My intention is to tabulate a
> syslog with my template and have it rotate when the log is exceed 1MB.
>
> At first i thought of
>
> $outchannel log_rotation,/var/log/syslog.log;CSVData, 1048576
> ,/usr/bin/rotate.sh
> *.* :omfile:$log_rotation
> But it not working, it just generate file known as syslog.log;CSVData
>
>
>
> --
> Sent from: http://rsyslog-users.1305293.n2.nabble.com/
> _______________________________________________
> rsyslog mailing list
> https://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
https://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.