Jq json file manipulation
viewing the top level structure for all objects
jq '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]' first10-10.json
jq -c 'path(..)|[.[]|tostring]|join("/")' first10-10.json
jq 'path(recurse(if type|. == "array" or . =="object" then .[] else empty end))' first10-10.json
jq '.[]|path(..)' first10-10.json
jq '.[]|keys' filename
viewing the top level structure for the first object
jq '.[0]|keys' filename
viewing the top level structure for the third object
jq '.[2]|keys' filename
viewing the first key for the first object
jq '.[0] | keys | .[0] filename
Getting the subkeys (when you know there are subkeys)
jq '.[0].data|keys' filename
selecting a specific item (from the top level)
jq '.[] | select(.id=bla)' filename
getting specific data from a subkey
jq '.[0].id' filename jq '.[].data.category.name' filename | sort -u
http://blog.librato.com/posts/jq-json