I currently appear to be having the same issue without the comma - I have a
couple of ideas I want to play with and then I'll get together a good test
case for you.

Brian

On Wed, Jul 11, 2012 at 1:01 PM, Rainer Gerhards
<rgerha...@hq.adiscon.com>wrote:

> I should have mentioned that I don't know of problems with templates -
> what of course does not mean there are none ;)
> Rainer
>
> > -----Original Message-----
> > From: rsyslog-boun...@lists.adiscon.com [mailto:rsyslog-
> > boun...@lists.adiscon.com] On Behalf Of Rainer Gerhards
> > Sent: Wednesday, July 11, 2012 7:01 PM
> > To: rsyslog-users
> > Subject: Re: [rsyslog] rsyslog 6 config format omfile output with
> > templates
> >
> > The comma probably has messed up the parser. I need to see that I emit
> > an error message if that happens. Pls do me a favor and open a bug
> > tracker so that I don't forget about this (it's currently rather busy).
> >
> > Rainer
> >
> > > -----Original Message-----
> > > From: rsyslog-boun...@lists.adiscon.com [mailto:rsyslog-
> > > boun...@lists.adiscon.com] On Behalf Of Brian Knox
> > > Sent: Wednesday, July 11, 2012 6:34 PM
> > > To: rsyslog-users
> > > Subject: Re: [rsyslog] rsyslog 6 config format omfile output with
> > > templates
> > >
> > > Still haven't gotten what I want working - but you did help me
> > realize
> > > I
> > > had an comma in my config I didn't mean to put in it (which explains
> > > one of
> > > my debug log messages at the very least).
> > >
> > > I'll keep poking at it - thanks for the response
> > >
> > > Brian
> > >
> > >
> > > On Wed, Jul 11, 2012 at 12:21 PM, Lars Peterson
> > > <lars.peter...@cision.com>wrote:
> > >
> > > > Perhaps something like this:
> > > >
> > > > *.* action { (name="file_log_all" type="omfile"
> > > > file="/data/rsyslog/logs/all.log", template="raw_template") }
> > > >
> > > > would work?
> > > >
> > > > I'm using an expression based action with v6 with something like
> > > this:
> > > >
> > > > if  $programname == 'myprogram' and ( $hostname contains_i 'host1'
> > or
> > > > $hostname contains_i 'host2' ) then { action(type="omfile"
> > > > file="/data/rsyslog/logs/all.log" template="raw_template") }
> > > >
> > > > and it seems to work fine.
> > > >
> > > > Thanks
> > > >
> > > > -----Original Message-----
> > > > From: rsyslog-boun...@lists.adiscon.com [mailto:
> > > > rsyslog-boun...@lists.adiscon.com] On Behalf Of Brian Knox
> > > > Sent: Wednesday, July 11, 2012 10:07 AM
> > > > To: Rainer Gerhards; rsyslog-users
> > > > Subject: [rsyslog] rsyslog 6 config format omfile output with
> > > templates
> > > >
> > > > Is it possible that applying a template to an omfile output using
> > > rsyslog
> > > > 6 config format is currently bugged?
> > > >
> > > > Here's my conf:
> > > >
> > > > -------------------------------------------------------------------
> > --
> > > --------------------------------------------------
> > > >
> > > > $ModLoad immark         # provides --MARK-- message capability
> > > > $ModLoad imuxsock       # provides support for local system logging
> > > (e.g.
> > > > via logger command)
> > > > $ModLoad imklog         # kernel logging (formerly provided by
> > > rklogd)
> > > > $ModLoad imtcp          # tcp input
> > > > $ModLoad imptcp         # high performance tcp input
> > > > $ModLoad impstats       # stats module
> > > > $ModLoad mmjsonparse    # json parser
> > > >
> > > >
> > > > $template raw_template,"hello this is from my template: %msg%\n"
> > > >
> > > > *.* action(name="file_log_all" type="omfile"
> > > > file="/data/rsyslog/logs/all.log", template="raw_template")
> > > > *.* /data/rsyslog/logs/all_v5.log;raw_template
> > > >
> > > >
> > > > -------------------------------------------------------------------
> > --
> > > -------------------------------------------------------
> > > >
> > > > [root@stor1 logs]# tail -n1 all.log
> > > > 2012-07-11T14:58:12.442511+00:00 stor1 briank: here we go
> > > >
> > > > [root@stor1 logs]# tail -n1 all_v5.log
> > > > hello this is from my template:  here we go
> > > >
> > > > So, it's working with the old style config but not the new.
> > > >
> > > > I've included a debug log (ignore the mess at the end it's just me
> > > > ctrl-c'ing out of rsyslog).
> > > >
> > > > I did notice this oddity in it:
> > > >
> > > > 9033.363104814:7f3836d34700: cnf:global:cfsysline: $template
> > > > raw_template,"hello this is from my template: %msg%\n"
> > > > 9033.363116744:7f3836d34700: INOBJ: invalid char ','
> > > > 9033.363122201:7f3836d34700: cnf:global:rule
> > > >
> > > > And this looks like it could be something:
> > > >
> > > > 9033.363355001:7f3836d34700: template:  'raw_template'
> > > > 9033.363367412:7f3836d34700: Module builtin:omfile processes this
> > > action.
> > > > 9033.363373954:7f3836d34700: template: 'RSYSLOG_FileFormat'
> > assigned
> > > >
> > > > Thanks!
> > > >
> > > > 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
> > > >
> > > _______________________________________________
> > > 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
> _______________________________________________
> 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