[syslog-ng]Sending mail to root?

Florian Lindner syslog-ng@lists.balabit.hu
Tue, 2 Sep 2003 21:18:26 +0200


Am Mittwoch 20 August 2003 21:40 schrieb Achim Gsell:
> On Wednesday 20 August 2003 00:56, Florian Lindner wrote:
> > Am Dienstag, 19. August 2003 22:22 schrieb Achim Gsell:
> > > On Tuesday 19 August 2003 17:25, Amodiovalerio Verde wrote:
> > > > i don't remeber if the program template is in 1.6 but i think there
> > > > is a patch somewhere...
> > > >
> > > > that's why i suggested writing a mini-parser...that way you could
> > > > format things better...
> > > >
> > > > btw ... search for the program template patch in the mailing list or
> > > > try to see if it's already with syslog-ng 1.6...
> > >
> > > It is! In version 1.6rc{1,2,3} you can use templates for all
> > > destinations types.
> >
> > How does it work?
> >
> > I've set up a destination:
> >
> > destination d_mailroot { program("/root/bin/sendline.sh '[syslog
> > exception] Level: $LEVEL, Facility: $FACILITY'"); };
> >
> > But mails subject is like that: "syslog exception] Level: $LEVEL,
> > Facility: $FACILITY"
> > The macros are not expanded.
> > I'm using 1.6 rc3
>
> Try something like the definition below and read the manual!
>
> destination d_mailroot {
>         program("/root/bin/sendline.sh"
>                 template("$DATE $HOST [$FACILITY.$LEVEL] $MSG\n")
>                 template_escape(no)
>         );
> };

Thanks, it works.
But is also possible to use templates as the program? So that I can give 
$LEVEL as a parameter to sendline.sh?
Thanks,
Florian