Link Search Menu Expand Document

pretty

jq '.'

get first element

 jq '.[0]'

get specific fields

jq '.[0] | {message: .commit.message, name: .commit.committer.name}'

get all elements

jq '.[0] | {message: .commit.message, name: .commit.committer.name}'

get output as single array

jq '[.[] | {message: .commit.message, name: .commit.committer.name}]'

get mult elements

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

Copyright © 2020 Thence LLC