Skip to content

JQ Cheat Sheet

Basic Selectors

# Select a specific field
echo '{"foo": "bar"}' | jq '.foo'

Filtering

# Select objects where status is 'running'
kubectl get pods -o json | jq '.items[] | select(.status.phase == "Running") | .metadata.name'