Skip to content

Instantly share code, notes, and snippets.

@Wicaeed
Created April 6, 2018 20:59
Show Gist options
  • Save Wicaeed/10bd1f76aa84941484f282b530c20360 to your computer and use it in GitHub Desktop.
Save Wicaeed/10bd1f76aa84941484f282b530c20360 to your computer and use it in GitHub Desktop.
Compare own NodeID vs RemoteManagers NoteID and filter out own result
{
"NodeID": "phlc5hx7g2hyhj4f3m1s70il6",
"RemoteManagers": [
{
"NodeID": "40jskir4t55o7fz8axpbhll9q",
"Addr": "10.23.217.200:2377"
},
{
"NodeID": "phlc5hx7g2hyhj4f3m1s70il6",
"Addr": "10.23.217.201:2377"
},
{
"NodeID": "iavpgnh0z36rjiiu964hti499",
"Addr": "10.23.217.202:2377"
}
],
}
docker info --format "{{json .}}" | jq '.Swarm[] |select (.RemoteManagers.NodeID != .NodeID)'
jq: error (at <stdin>:1): Cannot index string with string "NodeID"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment