Top "Jq" questions

jq is a sed-like tool for JSON data – you can use it to slice, filter, map, and transform structured data with the same ease that sed, awk, grep and friends lets you play with text.

Select objects based on value of variable in object using jq

I have the following json file: { "FOO": { "name": "Donald", "location": "Stockholm" }, "BAR": { "name": "Walt", "location": "Stockholm" }, "BAZ": { "name": "Jack", "location": "…

json bash select jq
How to filter an array of objects based on values in an inner array with jq?

Given this input: [ { "Id": "cb94e7a42732b598ad18a8f27454a886c1aa8bbba6167646d8f064cd86191e2b", "…

arrays json select jq negation
Using jq to parse and display multiple fields in a json serially

I have this Json { "users": [ { "first": "Stevie", "last": "Wonder" }, { "first": "Michael", "last": "Jackson" } ] } Using jq I'd like to display first …

json jq
How to install JQ on Mac by command-line?

I need to know the most efficient way of installing JQ on Mac (el capitan). The code is downloaded to …

json macos command-line installation jq
How to count items in JSON object using command line?

I'm getting this kind of JSON reply from a curl command: [ { "cid": 49, "pyn": "yi4", "hans": "亿", "hant": "億", "tid": 68, "l10n": "cent …

json bash curl jq
How to get key names from JSON using jq

curl http://testhost.test.com:8080/application/app/version | jq '.version' | jq '.[]' The above command outputs only the …

json shell unix key jq
Passing bash variable to jq

I have written a script to retrieve certain value from file.json. It works if I provide the value to …

json bash environment-variables jq
How to merge 2 JSON objects from 2 files using jq?

I'm using the jq tools (jq-json-processor) in shell script to parse json. I've got 2 json files and want to merge …

json shell command-line jq
How do I select multiple fields in jq?

My input file looks something like this: { "login": "dmaxfield", "id": 7449977, ... } { "login": "dmaxfield", "id": 7449977, ... } I can get all the login names …

jq
Install jq JSON processor on Ubuntu 10.04

Is there a way to install jq JSON processor on Ubuntu 10.04? I Tried the usual sudo apt-get install jq but …

json ubuntu ubuntu-10.04 jq