Skip to main content

Questions tagged [jq]

Questions about the command line JSON processing tool jq.

-1 votes
1 answer
28 views

I need to add or update values in multiple arrays without removing existed array values. Also I need to create objects If they did not exist. somefile.json: { "messages": { "...
Zero's user avatar
  • 77
3 votes
2 answers
185 views

I'm trying to combine the arrays of two JSON files I need to achieve this by combining the arrays without removing existing values of arrays and without removing any object. Sorting output arrays ...
Zero's user avatar
  • 77
1 vote
2 answers
104 views

bash 4.4.20 and jq-1.6 on RHEL8 I get this nice output from jq and column. Hard to read, though. pgbackrest info --output=json \ | jq -r '.[] | .backup[] | "\(.type) \(.label) \(.info.delta)...
RonJohn's user avatar
  • 1,483
5 votes
2 answers
591 views

I want to get the value after a selected item in a list in jq. Something like this seems like it would work: jq '. as $list | select(.focused == true) | .id as $id | $list | select(????) One way of ...
Att Righ's user avatar
  • 1,432
2 votes
1 answer
103 views

I am attempting to edit an OpenAPI specification by changing all parameters to be nullable. A parameter definition looks like this: { "name": "foo", "required": ...
miken32's user avatar
  • 607
8 votes
3 answers
1k views

Say, I provide jq with the following JSON body as input: {"person1": {"name": "foo"}, "person2": {"name": "bar"}} Is it possible to have jq ...
Shuzheng's user avatar
  • 5,019
0 votes
1 answer
216 views

I tried this script to see kubernetes volumes usage k get pods -n elk | jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) ''{name: .pvcRef.name, capacityBytes, usedBytes, ...
Milenko Markovic's user avatar
5 votes
2 answers
433 views

I'm using an API (from SyncroMSP) that returns paginated JSON data. I can obtain the number of pages, and I can obtain the data with a tool such as curl. Each chunk is valid JSON but it only contains ...
Chris Davies's user avatar
6 votes
2 answers
412 views

I have a huge JSON object with an array of objects inside it. I have to add key:value pair to a specific object in the array. For example, let the input object is: { "a": { "b&...
Vlado B.'s user avatar
3 votes
1 answer
354 views

I want to output a specific key of list of a list of hashes as lines where each outer array item is separated by an empty line. To illustrate: Input is: [ [ { "visible": true, ...
Orangenhain's user avatar
1 vote
1 answer
2k views

I have a JSON which looks like: { "type": "server-firmwareinventory-list-1", "members": [ { "type": "sever-hardware-firmware-1", &...
user2664304's user avatar
1 vote
1 answer
88 views

how do I get jq to take json like this: { "responseHeader":{ "status":0, "QTime":1 }, "cluster":{ "collections":{ "...
Claudio Favaro's user avatar
3 votes
2 answers
2k views

$ n="foo"; echo "{}" | jq --arg n "$n" '. += { "$n": $n }' { "$n": "foo" } My reading of https://jqlang.github.io/jq/manual/#types-and-...
Richard Barraclough's user avatar
3 votes
2 answers
736 views

I recently discovered jq and gron. For my use case, gron is sufficient, but I am a little worried by lack of development. There are some bugs that have not been addressed in an year, while I see that ...
Francesco Potortì's user avatar
11 votes
3 answers
886 views

I'd like to pretty print the ip addresses and show the output in in tabular format, including all the meta data such as valid_lft, temporary, etc. I figured out that ip -j addr show eth0 is giving me ...
hanjo's user avatar
  • 235

15 30 50 per page
1
2 3 4 5
28