|
|
|
|
|
by rwiggins
2044 days ago
|
|
I regularly use jq to summarize the structure of big JSON blobs, using the snippet written here (I alias it to "jq-structure"): https://github.com/stedolan/jq/issues/243#issuecomment-48470... For example, against the public AWS IP address JSON document, it produces an output like $ curl -s 'https://ip-ranges.amazonaws.com/ip-ranges.json' | jq -r '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]'
.
.createDate
.ipv6_prefixes
.ipv6_prefixes[]
.ipv6_prefixes[].ipv6_prefix
.ipv6_prefixes[].network_border_group
.ipv6_prefixes[].region
.ipv6_prefixes[].service
.prefixes
.prefixes[]
.prefixes[].ip_prefix
.prefixes[].network_border_group
.prefixes[].region
.prefixes[].service
.syncToken
This plus some copy/paste has worked pretty well for me. |
|
That jq query looks like an unwise Perl one-liner.