Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
Created July 30, 2015 10:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ipedrazas/e3ae3ddb98b2e85c8370 to your computer and use it in GitHub Desktop.
Save ipedrazas/e3ae3ddb98b2e85c8370 to your computer and use it in GitHub Desktop.
Consul.io KV get value from bash
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
@alexsorkin
Copy link

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

@uts09
Copy link

uts09 commented Jun 8, 2017

curl -s 10.0.0.145:8500/v1/kv/my_key/my_otehr_key/this_is_the_key?raw

@qfrank
Copy link

qfrank commented Jun 18, 2019

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