I have a server with a bunch of processes writing log files as they run. I need to enable a client host to get a replica of the server-side log files in a near real-time manner. Is there a better way than simply combining tail with netcat?
I was thinking of using tail with netcat on the server side to stream multiple log files through a single connection:
tail -F *.log | nc -lk -p 31377
While the client side would demultiplex the logs and write them to files:
nc serverhost 31377 | demultiplexer
Where demultiplexer is simply built around sed, figuring destination filenames from separators inserted by tail on the server side:
sed -e 's/==> \(.*\) <==/\1/'