Skip to content

Instantly share code, notes, and snippets.

@OlegGorj
Created September 17, 2018 18:54
Show Gist options
  • Save OlegGorj/2d9ec7d402172fd5cc906213a2c5bde4 to your computer and use it in GitHub Desktop.
Save OlegGorj/2d9ec7d402172fd5cc906213a2c5bde4 to your computer and use it in GitHub Desktop.
Decode value from Consul
  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

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

or

  curl -s 10.0.0.145:8500/v1/kv/my_key/my_otehr_key/this_is_the_key?raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment