consul watch -type key -key mhc ./key_handler.py

[root@mhc consul]# cat key_handler.py
#!/usr/bin/python
import sys
import base64
import json

print "key handler..."
res = sys.stdin.read()
res = json.loads(res)
print res['Value']
value = base64.b64decode(res['Value'])
res['Value'] = value
print json.loads(value)

[root@mhc consul]# cat key-handler.sh


echo key handler...
echo $(cat)