Skip to content

Instantly share code, notes, and snippets.

@fujiwara
Created May 18, 2015 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujiwara/dc4309d3866e3c47abe8 to your computer and use it in GitHub Desktop.
Save fujiwara/dc4309d3866e3c47abe8 to your computer and use it in GitHub Desktop.
multitail-consul
#!/bin/bash
set -e
node="$1"
cmd="$2"
nodes=$(consul members -status alive | awk "/$node/{ print \$1 }")
args=()
for n in $nodes
do
args=("${args[@]}" "-L")
args=("${args[@]}" "ssh $n $cmd")
done
multitail --mergeall "${args[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment