{ "items":[
{
"metadata":{"name":"127.0.0.1"},
"status":{
"capacity":{"cpu":3}
}
},
{
"metadata":{"name":"127.0.0.2"},
"status":{
"capacity":{"cpu":8}
}
} ] }
ich folgendes zu tun:Wie überspringen Iteration in JQ
.items[] | if .metadata.name=="127.0.0.1" then {cpu: .status.capacity.cpu} else <<I want to skip>> end
Ich möchte überspringen, wenn der 1. weiterhin falsch
Erforderliche Leistung:
{"cpu":3}
Können Sie das tun? Mann, der downvote gibt – aerokite