Scenario:
I can watch logs on the remote Unix machine using ssh and tail but I cannot install software. I want to use something like multitail or other log viewer which is not available on the remote machine to watch the log files. Of course, if I could find a way to create live local copies of the logs as they are being written, I can use what ever software I want on the local machine.
Question:
Would it be possible to do something like re-direct the output of the ssh client to a file for this purpose or is there another way to accomplish this goal?
Yes, you can do this by using netcat. Note that if you do not incorporate it into the chain, the log file will be sent over the network unencrypted, which can be a security risk for some log files.
The idea is that you use
netcat, which basically works like a pipe over the network.1. On the machine that holds the log file, do:
2. On the machine that wants to further process the file, do:
Or you can also write to a file on the target machine with ‘>’ and then use multitail on that file.
The port number is to be chosen by you, a 16bit number larger than 1024.