Transform all strings recursively
Convert every string value in the document to lowercase
jq 'walk(if type == "string" then ascii_downcase else . end)' data.json
More jq commands
-
cat data.json | jq '.'Format and colorize a JSON file
-
cat data.json | jq '.items[] | select(.status == "Running")'Select items whose status field equals Running
-
cat data.json | jq '[.items[] | {name:.metadata.name, ns:.metadata.namespace}]'Build a new array with only the name and namespace of each item
-
cat data.json | jq 'group_by(.namespace) | map({ns: .[0].namespace, count: length})'Group items by namespace and count them in each group
-
cat data.json | jq 'del(.metadata.managedFields)'Hide managedFields, the noisiest part of any kubectl output