I've got a JSON object like so:
{
"1": {
"available_memory": 1086419656.0,
"available_memory_no_overbooking": 1086419656.0,
"conns": 1.0
},
"2": {
"available_memory": 108641236.0,
"available_memory_no_overbooking": 10861216.0,
"conns": 2.0
}
}
I want to retrieve the value of "conns" atribute for each object id. I am new at jq and I cant found clear examples.
I have tried the following:
echo "$OUTPUT" | jq -r .[].conns
Which returns all the values for conns, but thats is not what I needed. The spected output would be:
1 1.0
2 2.0
Any ideas?