[syslog-ng]Sending mail to root?
Florian Lindner
syslog-ng@lists.balabit.hu
Thu, 21 Aug 2003 01:00:29 +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)
> );
> };
Which manual?
In http://www.balabit.com/products/syslog_ng/reference/book1.html I've found
nothing about templates.
I really would like to understand templates. (right now I don't for example
what is template_escape?)
Thanks,
Florian