I'm building a script to process JSON for specifc Chef/node data. I need to get the name of each object as it will be different every time. Typically I use jsawk but this is only helpful if you know the name of the object.
A solution should work on either of the below examples:
{"keepalived":{"role":"MASTER","vip":"192.168.4.113"},"mysql":{"service_name":"singularitydb"},"haproxy":{"role":"MASTER"}}
Should return: keepalived,mysql,haproxy
{"nginx":{"attribute":"standalone"},"haproxy":{"role":"MASTER"}}
Should return: nginx,haproxy