Skip to content

Instantly share code, notes, and snippets.

@djmaze
Created June 15, 2014 16:38
Show Gist options
  • Save djmaze/f451c646a35736dd95ff to your computer and use it in GitHub Desktop.
Save djmaze/f451c646a35736dd95ff to your computer and use it in GitHub Desktop.
Tail on multiple CoreOS servers in parallel
#!/bin/sh
#
# Run like this:
#
# coreos-multitail.sh core@xxx core@yyy ...
SERVERS=($*)
echo Tailing ${SERVERS[@]}, press CTRL-C to exit
trap ctrl_c int
function ctrl_c() {
kill 0
}
for SERVER in ${SERVERS[@]}; do
ssh -n $SERVER "journalctl -f" | awk -F "\n" "{ print \"$SERVER \" \$1 }" &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment