Hi all! I have a problem with the program destination when having the following in my syslog-ng.conf file ###start options { long_hostnames(off); sync(0); }; source src { unix-stream("/dev/log"); internal(); }; destination dhcp { program("script-program"); }; filter f_dhcp { program("dhclient"); }; log { source(src); filter(f_dhcp); destination(dhcp); }; ###stop it will run the script-program once when reloading syslog-ng not when matching the filter. Though, if I alter the destination line to ### start destination dhcp { file("/var/log/dummy"); }; ### stop it will output (as I thought and like :) to this dummy log everytime it matches the filter, not once when reloading syslog-ng. I would like my first destination file to behave in a similar manner, that is when doing a program destination it should run the script each time it matches the filter. Is it just me or is something else? Been trying to find it for hours now, searching through this mailing lists archive, searching the docs... but without success. I really hope you can help me out here. Ooops forgot my setup is syslog-ng version 1.4.10 debian 2.2r2 sparc on a sparc station 10 (40MHz wee! :) Yours, /Robert -- Computational Linguistics Department of Linguistics Göteborg University
The program destination runs the program once, and keeps it running. You should read messages line by line like this: #!/bin/sh while read line; do echo $line | mail -s "log alert" done -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1 url: http://www.balabit.hu/pgpkey.txt
"you" == Balazs Scheidler <bazsi@balabit.hu> writes: you> The program destination runs the program once, and keeps it you> running. You should read messages line by line like this:
you> #!/bin/sh you> while read line; do you> echo $line | mail -s "log alert" you> done thanks for everybodies' quick replies! and for my defense -- doh, i must have been to tired... ;) Yours, /Robert -- Computational Linguistics Department of Linguistics Göteborg University
participants (2)
-
Balazs Scheidler
-
Robert Andersson