Created
April 6, 2018 20:59
-
-
Save Wicaeed/10bd1f76aa84941484f282b530c20360 to your computer and use it in GitHub Desktop.
Compare own NodeID vs RemoteManagers NoteID and filter out own result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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