Answer the question
In order to leave comments, you need to log in
How can one select the same key from different JSON keys?
JSON available
{
"key_abc123": {
"a": "1",
"b": "sj",
"ip": "4.15.0.1"
},
"key_defg4567": {
"a": "1",
"b": "sj",
"ip": "4.15.0.6"
},
"key_hi89": {
"a": "1",
"b": "sj",
"ip": "4.15.0.4"
}
}
Answer the question
In order to leave comments, you need to log in
I came up with such a crutch on the head:
echo $JSON | jq --raw-output '.[].ip' > array
while read IP
do
тут действие для каждого ip адреса
done < array
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question