Questions tagged [jq]

Questions about the command line JSON processing tool jq.

Filter by
Sorted by
Tagged with
5
votes
5answers
703 views

parse colon separated value pairs

I've written a script that converts nmcli --mode multiline dev wifi into json but I'm finding it's inconsistent (breaks when results have a space), long, and hard to read. I'm wondering if it is ...
2
votes
0answers
229 views

process JSON format with JQ tools [closed]

I want check format keys in bash script. In my json if any keys match this format key[0-9][0-9]_$ my script exit 1 else exit 2. I want use JQ tools. Bash: #!/bin/bash json=$(cat <<EOF {"key11"...
1
vote
2answers
246 views

JQ (GET ID based on NAME)

I get a long list of such arrays { "id": "byu6g6c4cjys5mdkg5znh8ju8c", "create_at": 1511875272294, "update_at": 1511875272294, "delete_at": 0, "display_name": "BMA", "name": "...
4
votes
1answer
3k views

Match keys with regex in jq [closed]

I'm writing a script that analyses JSON input (jsonfile): { "key11":1010,"key11_yes":13,"key11_no":14, "key12":12120,"key12_yes":9,"key12_no":25, "key13":12103,"key13_yes":13,"key13_no":20 ...
0
votes
1answer
185 views

jq: parse json file with constraint from other field [duplicate]

Extend of this question: How to combine strings from JSON values, keeping only part of the string? Above link's output also include the "name" of folder type, need to exclude these "type": ...