-
-
Save iolloyd/da60ef316643d7894bdf to your computer and use it in GitHub Desktop.
tail -f multiple log files in your local machine over ssh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for $server in server-1 server-2 server-3 server-4; do | |
ssh -t $server -f "tail -f /var/log/some-process/error.log|sed -e 's/^/$server /'" & | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add the server name to the beginning of each log line. kudos @ivantumanov