Mailing List Archive

Property filter - output formatting
Hello,

I've started exploring rsyslog 3.20.2

As I have been toying around and looking at the example configurations, I
have not been able to solve the following problem:

how can I use a property filter to select an output file AND format the
output using a defined template

For instance:

$template testtemplate,"%msg%"

:syslogtag, contains, "test" /tmp/test.log;testtemplate

Doesn't seem to be a supported syntax (it works when I leave off the
;testtemplate).

I'm sorry if this is obvious, but how can I filter based on properties AND
specify output formatting at the same time?

Thanks,
Pieter





_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com
Re: Property filter - output formatting [ In reply to ]
Hi Pieter,

I just tried this out in lab. For me, it works. If I generate a message
with

logger -t test my message

the message is properly dispatched. I guess that the problem actually is
the tag, which I guess does not contain what you think it does (a
frequent problem with many senders). Try this template

$template testtemplate,"tag: '%syslogtag%', rawmsg: '%rawmsg%'\n"
*.* /some/file;testtemplate

and let us know the result.

HTH
Rainer

On Wed, 2009-01-14 at 13:37 +0100, pieter.thysebaert@intec.ugent.be
wrote:
> Hello,
>
> I've started exploring rsyslog 3.20.2
>
> As I have been toying around and looking at the example configurations, I
> have not been able to solve the following problem:
>
> how can I use a property filter to select an output file AND format the
> output using a defined template
>
> For instance:
>
> $template testtemplate,"%msg%"
>
> :syslogtag, contains, "test" /tmp/test.log;testtemplate
>
> Doesn't seem to be a supported syntax (it works when I leave off the
> ;testtemplate).
>
> I'm sorry if this is obvious, but how can I filter based on properties AND
> specify output formatting at the same time?
>
> Thanks,
> Pieter
>
>
>
>
>
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com