You can use jq '.[] | .login, .id' to obtain each login followed by its id.
Earthly
earthly.dev › blog › jq-select
JQ Select Explained: Selecting elements from JSON with Examples - Earthly Blog
July 24, 2023 - It’s similar to the WHERE clause in a SQL statement or array filter in JavaScript. Like map, I find select comes up quite a bit, so while you may have to come back to this article or google it the first few times you need it, with luck, it will start to stick to your memory after that. ... curl https://api.github.com/repos/stedolan/jq/issues?per_page=100 | \ jq 'map({ title: .title, number: .number, labels: .labels | length }) | map(select(.labels > 0))'
How do I select multiple keys for output?
This seems like a basic question but I can't find examples anywhere in the documentation. If I have input like - alpha: 1 beta: foo gamma: 0.3 delta: bar - alpha: 2 beta: baz gamma: 1.23 delta: buz... More on github.com
JQ and Multiple Fields with a SELECT - Stack Overflow
echo "$json_string" | jq '.checks | .[] | select(.status != "OK")' More on stackoverflow.com
json - Get field and nested field at the same time using jq - Unix & Linux Stack Exchange
> cat rm111.json | jq -r '.issues[] | .key' RM-111 > cat rm111.json | jq -r '.issues[] | .fields.summary' 6.6.0 More on unix.stackexchange.com
javascript - single select box filling in multiple fields (jQ maybe?) - Stack Overflow
I have a select box and I'd like to make it fill in fields (something like id ), would it be possible to fill in More on stackoverflow.com
Mark Needham
markhneedham.com › blog › 2021 › 05 › 19 › jq-select-multiple-keys
jq: Select multiple keys | Mark Needham
May 19, 2021 - And then to flatten it out into single arrays instead of nested ones, we can pipe the result through the .[] selector: cat swagger-clean.json | jq -r '.paths | keys[] as $k | [ (.[$k] | keys[] as $k1 | [$k, $k1, .[$k1].operationId, .[$k1].summary] ) ] | .[]'
jq
jqlang.org › manual
jq 1.8 Manual
A jq program is a "filter": it takes an input, and produces an output. There are a lot of builtin filters for extracting a particular field of an object, or converting a number to a string, or various other standard tasks. Filters can be combined in various ways - you can pipe the output of one filter into another filter, or collect the output of a filter into an array. Some filters produce multiple results, for instance there's one that produces all the elements of its input array.
Gunnar Morling
morling.dev › blog › extracting-and-propagating-multiple-values-with-jq
Shell Spell: Extracting and Propagating Multiple Values With jq - Gunnar Morling
July 6, 2024 - jq is invaluable for handling JSON and I highly recommend spending some time with its reference documentation to learn about it. For the case at hand, the select() function is used within a pipeline for finding the right elements within the array of Terraform child modules and extracting the required values.
Stedolan
stedolan.github.io › jq › manual
Redirecting to jqlang.github.io
Redirecting to jqlang.github.io
CopyProgramming
copyprogramming.com › howto › jq-select-multiple-fields-from-array
Mastering jq: Selecting Multiple Fields from Arrays and 2026 Best Practices - Jq select multiple fields from array
November 21, 2025 - This practice prevents null pointer exceptions and data corruption in consuming applications. jq 1.8.1 is the latest stable version for 2026, offering security fixes and performance improvements over earlier releases · The pick() function provides the cleanest syntax for selecting multiple ...
Stack Overflow
stackoverflow.com › questions › 79569370 › jq-and-multiple-fields-with-a-select
JQ and Multiple Fields with a SELECT - Stack Overflow
echo "$json_string" | jq '{"summary": .summary, "checks":[.checks[] | select(.status != "OK")]}'
Stack Overflow
stackoverflow.com › questions › 5236982 › single-select-box-filling-in-multiple-fields-jq-maybe
javascript - single select box filling in multiple fields (jQ maybe?) - Stack Overflow
$(function(){ $('select').change(function(){ // this is the selected option: var selected = $(this).children('option:selected')[0] //input box1: $('input.input1').val($(selected).attr('data-core')) //input box2 $('input.input2').val($(selected).attr('data-cco')) }) }) ... thanks, just out of curiosity what is all the $($( for? i haven't used jquery often, sorry if its dumb question.
HackingNote
hackingnote.com › en › cheatsheets › jq
Cheatsheet - jq
Multiple fields: # from top level $ cat file.json | jq '. | {field1, field2}' # from sub level $ cat file.json | jq '.results[] | {id, name}' Extract as text values instead of JSON (getting rid of quotes), use -r: $ cat file.json | jq -r '.a.b[0].c' Slice an array · $ echo '["a", "b", "c", "d"]' | jq '.[1:3]' # get "name" of id 1 $ cat file.json | jq '.results[] | select(.id == "1") | {name}' # get result with multiple filters $ cat file.json | jq '.results[] | select((.id == "1") and (.name="a"))' # filter with substrings $ cat file.json | jq '.results[] | select(.name | contains("ab"))' # filter with regex $ cat file.json | jq '.results[] | select(.name | test("Joe\s+Smith"))' Given a list (items[]), find the item according to .spec.foo, change the value of .spec.bar to baz: cat file.json | jq '(.items[] | select(.spec.foo == "key")).spec.bar |= "baz"' Selectors start with ..
Top answer 1 of 2
557
jq supports the Boolean operators and/or/not, so it would look like:
.[] | select((.processedBarsVolume <= 5) and .processedBars > 0)
2 of 2
11
I had to wrap the piping to startswith with parentheses in order to make this work.
jq -n 'env | with_entries(select ((.key|startswith("CI_")) or .key == "DOCKER_CONTAINER_VERSION_TAG"))'
Lekkimworld
lekkimworld.com › 2018 › 09 › 07 › jq-and-multi-field-output-to-csv
jq and multi-field output to CSV – lekkimworld.com
September 7, 2018 - $ sfdx force:schema:sobject:describe -s Account -u myorg --json | jq -r ".result.fields[] | .label, .name" Age Age__pc PO Box PO_Box__pc Postal Code Before City Postal_Code_Before_City__pc Street No Before Street Street_No_Before_Street__pc Archived State Archived_State__pc