[syslog-ng]Sending mail to root?

Achim Gsell syslog-ng@lists.balabit.hu
Wed, 20 Aug 2003 21:40:05 +0200


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)
        );
};


Achim