Hi all, I've set up syslog on my gateway to forward all messages to a server and rotate its own logs out on a daily basis. So far so good, the server is logging for the gateway with no problem. That said, I'd like to filter off the forwarded messages to a separate file, say /var/log/ gateway.messages but I can see no options in syslog.conf (and the docs) to accomplish this. Is it possible? How can I go about it? Cheers Dylan -- Sweet moderation Heart of this nation Desert us not We are between the wars - Billy Bragg
Sun, 04 Jan 2004, by dylan@dylan.me.uk:
Hi all,
I've set up syslog on my gateway to forward all messages to a server and rotate its own logs out on a daily basis. So far so good, the server is logging for the gateway with no problem. That said, I'd like to filter off the forwarded messages to a separate file, say /var/log/ gateway.messages but I can see no options in syslog.conf (and the docs) to accomplish this. Is it possible? How can I go about it?
Make a fifo (man mkfifo), pipe syslog messages to the fifo, read in with an awk|perl|bash|.. script that outputs to a file if it sees a particular (hostname) regexp. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 27N , 4 29 45E. SUSE 8.2 Kernel k_athlon-2.4.20 See headers for PGP/GPG info.
On Sun, Jan 04, 2004 at 04:00:58PM +0100, Theo v. Werkhoven wrote:
Sun, 04 Jan 2004, by dylan@dylan.me.uk:
Hi all,
I've set up syslog on my gateway to forward all messages to a server and rotate its own logs out on a daily basis. So far so good, the server is logging for the gateway with no problem. That said, I'd like to filter off the forwarded messages to a separate file, say /var/log/ gateway.messages but I can see no options in syslog.conf (and the docs) to accomplish this. Is it possible? How can I go about it?
Make a fifo (man mkfifo), pipe syslog messages to the fifo, read in with an awk|perl|bash|.. script that outputs to a file if it sees a particular (hostname) regexp.
Or switch to syslog-ng. It's included, and does what you want, among other things. HTH Jon -- Whatever rocks your boat!
On Sunday 04 January 2004 15:38 pm, Jon Clausen wrote:
On Sun, Jan 04, 2004 at 04:00:58PM +0100, Theo v. Werkhoven wrote:
Sun, 04 Jan 2004, by dylan@dylan.me.uk:
Hi all,
I've set up syslog on my gateway to forward all messages to a server and rotate its own logs out on a daily basis. So far so good, the server is logging for the gateway with no problem. That said, I'd like to filter off the forwarded messages to a separate file, say /var/log/ gateway.messages but I can see no options in syslog.conf (and the docs) to accomplish this. Is it possible? How can I go about it?
Make a fifo (man mkfifo), pipe syslog messages to the fifo, read in with an awk|perl|bash|.. script that outputs to a file if it sees a particular (hostname) regexp.
Or switch to syslog-ng.
It's included, and does what you want, among other things.
Thanks, Jon - that does the trick nicely! Dylan
HTH Jon
-- Whatever rocks your boat!
-- Sweet moderation Heart of this nation Desert us not We are between the wars - Billy Bragg
participants (3)
-
Dylan
-
Jon Clausen
-
Theo v. Werkhoven