Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Last active February 22, 2023 09:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iolloyd/da60ef316643d7894bdf to your computer and use it in GitHub Desktop.
Save iolloyd/da60ef316643d7894bdf to your computer and use it in GitHub Desktop.
tail -f multiple log files in your local machine over ssh
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
@iolloyd
Copy link
Author

iolloyd commented Mar 3, 2015

Add the server name to the beginning of each log line. kudos @ivantumanov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment