[syslog-ng]Program destination ?

Andy Kirkpatrick syslog-ng@lists.balabit.hu
Tue, 27 Apr 2004 16:08:33 +1000


Hi David,

This is just a guess, but the output buffer of syslog-ng would be
holding more than one line, which is set with option log_fifo_size.
Consoles tend to be line buffered while pipes are
block/chunk/arbitrarily buffered. Try sending a few hundred messages and
see if they come through all at once. Or it could be more related to the
sync option, the number of lines buffered before being written to file
(not sure if that applies to program targets).

I can't see anything wrong with your config, we have a similar setup
where I work and I haven't seen the problem you mention.

HTH,
Andy Kirkpatrick

-----Original Message-----
From: syslog-ng-admin@lists.balabit.hu
[mailto:syslog-ng-admin@lists.balabit.hu] On Behalf Of David Vaartjes
Sent: Friday, 23 April 2004 8:16 PM
To: syslog-ng@lists.balabit.hu
Subject: [syslog-ng]Program destination ?

Hello list,

I'm testing syslog-ng to send certain messages to the stdin of a
program. I've set the following lines in "syslog-ng.conf" to accomplish
this:

<CONFIG-LINES>
destination alerter { program("/home/dv/download/perl-test.pl"); };

filter f_special {
         match("special");
};

log { source(src); filter(f_special); destination(alerter); };
</CONFIG-LINES>

The perl-test.pl looks like:

<PERL-TEST.PL>
#!/usr/bin/perl

while (<>)
{
         print $_ . "\n";
}
</PERL-TEST.PL>

If I do a 'logger -p daemon.notice "special"' the message is not send to
the stdin of perl-test.pl. However, if i do a 'echo "test"=20
 > /proc/3240/fd/0" the data is send to the stdin of perl-test.pl and
shown on the console by perl-test.pl as expected.

I can't figure out why syslog isn't sending messages to perl-test.pl. If
i change the "destination" in syslog-ng.conf to write to a file,
everything works fine.

Hope someone can shed some light on this one.

Thanks in advance,

David

_______________________________________________
syslog-ng maillist  -  syslog-ng@lists.balabit.hu
https://lists.balabit.hu/mailman/listinfo/syslog-ng
Frequently asked questions at http://www.campin.net/syslog-ng/faq.html