Skip to content

Instantly share code, notes, and snippets.

@bdargan
Created January 18, 2013 05:29
Show Gist options
  • Save bdargan/4562562 to your computer and use it in GitHub Desktop.
Save bdargan/4562562 to your computer and use it in GitHub Desktop.
jq command line json query processor tips. from stedolan/jq

cat tmp.results| ~/bin/jq '.hits.hits[]._source | select(.address) |.address'

"192.168.1.1"

cat tmp.results| ~/bin/jq '.hits.hits[]._source | select(.address) |{address,name}'

{
"name": "some name", "address": "192.168.1.1"

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment