views:

67

answers:

2

I wrote a Perl program to capture a live data stream from a tail command on a Linux machine using the following command in the console:

tail -f xyz.log | myperl.pl

It works fine. But now I have to execute this Perl program on a different machine because the log file is on that different machine. Can anyone tell me how I can do it?

+3  A: 

You could say

ssh remotemachine tail -f xyz.log | myperl.pl

I suppose or maybe mount the remote log directories locally onto your administrative machine and do the processing there.

Noufal Ibrahim
yes it worked....thanks a lot....
awaiskhan200
+2  A: 

Or you could even say

ssh remotemachine bash -c "tail -f xyz.log | myperl.pl"

in order to run the script on the remote machine (if your script produces some output files and you want them on remote machine)

hlynur
tried it as welll....thanks a lot...
awaiskhan200