You can use jq '.[] | .login, .id' to obtain each login followed by its id.
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.
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
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
json - JQ: Select multiple conditions - Stack Overflow
3 How to select a object in jq that matches on a greater or less than for multiple values in a attribute 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] ) ] | .[]'
Stack Overflow
stackoverflow.com › questions › 79569370 › jq-and-multiple-fields-with-a-select
JQ and Multiple Fields with a SELECT - Stack Overflow
# jq 1.7+ jq '.checks[] |= select(.status != "OK")' <<< "$json_string" # jq 1.3+ jq '.checks |= map(select(.status != "OK"))' <<< "$json_string"
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))'
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 ...
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"))'
Palmersteakhouse
palmersteakhouse.ca › educationai › jq-select-multiple-fields
jq select multiple fields
December 18, 2024 - The select function allows for more complex scenarios where you might only want to select certain fields based on a condition. Let's say you want to select only fields with string values: echo '{"name": "John Doe", "age": 30, "city": "New York", "isActive": true}' | jq 'select(type == "string")'
DcodeSnippet
dcodesnippet.com › home › programming › mastering jq select multiple fields for efficient data manipulation
Mastering Jq Select Multiple Fields For Efficient Data Manipulation | DcodeSnippet
May 12, 2024 - With jq, you can simply specify the fields you want to extract and let the tool do the work for you. This not only saves you time but also reduces the likelihood of errors creeping in during manual data extraction processes. ... Simplified Query Writing Another major benefit of using jq to ...
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
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.