Json

cat README.md | jq .
cat README.md | jq '.[].id'

Get a single scalar values + (different form, as a pipeline)

cat s1.json | jq ' .spec.replicas '
cat s1.json | jq ' .spec | .replicas '

Get two scalar values

cat s1.json | jq ' .spec.replicas, .kind '

Get two scalar values and concatenate/format them into a single string

cat s1.json | jq ' "replicas: " + (.spec.replicas | tostring) + " kind: " + .kind '

Select an object from an array of object based on one of the names

cat dep.json | jq ' .status.conditions | map(select(.type == "Progressing")) '

Extract, concatenate, select where key=value

Source

results matching ""

    No results matching ""

    results matching ""

      No results matching ""