So this weekend I was playing around with my log summarizer, which produces a line of output for each second with one character for each significant event coloured according to the machine on which it occurred. The output is all real-time, and quite mesmerizing to watch. Behind the cut is a static sample of the output.
All my email relays are logging via syslog to our admin box, which writes the output to a fifo. The summarizer can read the fifo directly, but that means only one person can view it at a time, and I can't do anything else with the log data feed while it is running.
So I wrote a little multiplexing program which will reads from a pipe or a fifo, and listens on a socket (unix domain or internet). Clients can connect to the socket and the multiplexer feeds them all a copy of the data it reads from the input. If the multiplexer is listening on a network socket then telnet is a suitable client, but I wrote a simpler one for use with unix domain sockets.
So the result of this is that I can write:
so whenever I connect to test_sock I get a copy of the amalgamated ppsw log feed.
and I can peel a feed off, pipe it through my shiny summarizer, and provide the output as a service on port 2000. I can then just telnet to it and get a feed.
It seems to me that logmux and loguse might turn out to be quite useful in the future.
( sample log summary output )
All my email relays are logging via syslog to our admin box, which writes the output to a fifo. The summarizer can read the fifo directly, but that means only one person can view it at a time, and I can't do anything else with the log data feed while it is running.
So I wrote a little multiplexing program which will reads from a pipe or a fifo, and listens on a socket (unix domain or internet). Clients can connect to the socket and the multiplexer feeds them all a copy of the data it reads from the input. If the multiplexer is listening on a network socket then telnet is a suitable client, but I wrote a simpler one for use with unix domain sockets.
So the result of this is that I can write:
logmux -f /var/log/ppsw_fifo -s /home/fanf2/logs/test_sock -c &
so whenever I connect to test_sock I get a copy of the amalgamated ppsw log feed.
loguse -s /home/fanf2/logs/test_sock | logfilter | logmux -s :2000
and I can peel a feed off, pipe it through my shiny summarizer, and provide the output as a service on port 2000. I can then just telnet to it and get a feed.
It seems to me that logmux and loguse might turn out to be quite useful in the future.
( sample log summary output )