Maybe the problem is that the template is not properly taken. Try this:

if ($programname == 'rsyslogd-pstats') then {
    action(name="parse" type="mmjsonparse")
    /data/rsyslog/logs/json_parse.log;parse_test
}

(yes, you can mix&match old and new style ... not that I recommend this, it's a 
side-effect of the need to support old style at all).

Rainer

> -----Original Message-----
> From: [email protected] [mailto:rsyslog-
> [email protected]] On Behalf Of Brian Knox
> Sent: Wednesday, June 13, 2012 4:06 PM
> To: rsyslog-users
> Subject: Re: [rsyslog] rule blocks and mmjsonparse
> 
> Some more information....
> 
> $template parse_test,"%$!all-json%\n"
> 
> if ($programname == 'rsyslogd-pstats') then {
>     action(name="parse" type="mmjsonparse")
>     action(name="pstats_file" type="omfile"
> file="/data/rsyslog/logs/pstats_json.log" template="parse_test")
> }
> 
> *.* :mmjsonparse:
> *.* /data/rsyslog/logs/json_parse.log;parse_test
> 
> Given the above, json_parse.log contains empty lines, while json_parse.log
> is correct.
> 
> 
> 
> 
> 
> On Tue, Jun 12, 2012 at 4:44 PM, Brian Knox <[email protected]> wrote:
> 
> > I have a situation on rsyslog 6 (dev branch!) where, using the new config
> > format, I'd like to run only messages that match a filter condition through
> > mmjsonparse.  First of all, is this possible, and secondly, what would the
> > syntax be?
> >
> > Essentially, in pseudoish code I want:
> >
> > if ($programname == 'rsyslogd-pstats') then {
> >     1. *.* mmjsonparse
> >     2. (send messages to an output using a template)
> > }
> >
> > Is it possible currently to use mmjsonparse against messages that only
> > match a filter condition?
> >
> > Brian
> >
> >
> _______________________________________________
> 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
_______________________________________________
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

Reply via email to