Created
July 30, 2015 10:20
-
-
Save ipedrazas/e3ae3ddb98b2e85c8370 to your computer and use it in GitHub Desktop.
Consul.io KV get value from bash
This file contains hidden or 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
curl -s 10.0.0.145:8500/v1/kv/my_key/my_otehr_key/this_is_the_key?dc=dc1 | jq -r '.[0].Value' | base64 --decode |
curl -s 10.0.0.145:8500/v1/kv/my_key/my_otehr_key/this_is_the_key?raw
curl -s 10.0.0.145:8500/v1/kv/my_key/my_otehr_key/this_is_the_key?raw
simplest way
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same with python (instead of jq), available on all systems with scratch installation:
curl -s 10.0.0.145:8500/v1/kv/my_key/my_otehr_key/this_is_the_key?dc=dc1 | python -c 'import json,sys;obj=json.load(sys.stdin);print obj[0]["Value"];' | base64 --decode