Skip to content

Instantly share code, notes, and snippets.

@potato2003
Last active November 8, 2019 04:59
Show Gist options
  • Save potato2003/a74108113b63e047a6a884f5bf396c10 to your computer and use it in GitHub Desktop.
Save potato2003/a74108113b63e047a6a884f5bf396c10 to your computer and use it in GitHub Desktop.
Adding server hostname to each line of output
$ echo HOST1 HOST2 | xargs -d ' ' -P2 -I{} ssh {} 'tail -F LOG_PATH | xargs -L 1 echo $(hostname): $1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment