Skip to content

Instantly share code, notes, and snippets.

@vytautaskubilius
Last active August 12, 2019 15:40
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 vytautaskubilius/a3b49f17c42ee662d8d281cfd652b2af to your computer and use it in GitHub Desktop.
Save vytautaskubilius/a3b49f17c42ee662d8d281cfd652b2af to your computer and use it in GitHub Desktop.
Bash function to search ScaleFT for a hostname
function sftsearch {
sft list-servers -o json | jq -r '.[]|select(.hostname | match(".*'$1'.*";"i"))|({"---- ":"----"},{id},{hostname},{access_address},{last_seen},{state},{"---- ":"----"})|to_entries[]|"\(.key): \(.value)"'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment