jq parser examples
# This produces a list of paths in the input:
jq -c 'path(..)|[.[]|tostring]|join("/")'
# Parse salt status output
jq -r 'to_entries | map({ key:.key, value: { total: [.value[]]|length ,\
succeed: [.value[]|select(.result == true)]|length,\
failed: [.value[]|select(.result == false)]|length,\
changes: [select(.value[].changes|length > 0)]|length }}) | from_entries '
# Grep some pattern on the random path
jq -e "..|${PATTERN}| select(.!=null)"
# Partial patch match
'.compute?.network