金山arp防火墙-win8输入法切换

2023年4月3日发(作者:jasperreport)
shelljq解析json
json数据:
{
"-live_hh":{
"a":1,
"b":2
},
"-live_bb":{
"a":1,
"b":2
},
"-live_bb":{
"a":1,
"b":2
}
}
jq解析filter:
to_entries|reduce.[]as$item
({"channel":[],"sink":[]};
if$|startswith("CHANNEL")
then
.+{"channel":(.channel+[$|capture("(?
else
.
end)
解析结果:
{
"channel":[
{
"topic":"live_hh",
"a":1,
"b":2
},
{
"topic":"live_bb",
"a":1,
"b":2
}
],
"sink":[]
}
官⽅⽂档:
reduce.[]as$sink({};if.|has($)then.|setpath([$,"BatchUnderflowCount"];$nderflowCount+.
[$].BatchUnderflowCount)|setpath([$,"BatchCompleteCount"];$ompleteCount+.
[$].BatchCompleteCount)|setpath([$,"ConnectionFailedCount"];$tionFailedCount+.
[$].ConnectionFailedCount)|setpath([$,"EventDrainAttemptCount"];$rainAttemptCount+.
[$].EventDrainAttemptCount)|setpath([$,"ConnectionCreatedCount"];$tionCreatedCount+.
[$].ConnectionCreatedCount)|setpath([$,"BatchEmptyCount"];$mptyCount+.
[$].BatchEmptyCount)|setpath([$,"ConnectionClosedCount"];$tionClosedCount+.
[$].ConnectionClosedCount)|setpath([$,"EventDrainSuccessCount"];$rainSuccessCount+.
[$].EventDrainSuccessCount)else.|setpath([$];
{"BatchUnderflowCount":$nderflowCount,"BatchCompleteCount":$ompleteCount,"ConnectionFailedCount":$s
end)
更多推荐
connectionfailed
发布评论