jq '.FiberSwitchPorts[]| { "port": .PortName?, "conn": .ConnectionFiberlines?[] , "mlayer": .Fiberlines?[]} ' | jq -s ' group_by(.port) | .[]| { port : .[0].port, conn: [
.[].conn],mlayer: [.[].mlayer] } '
jq '.FiberSwitchPorts[]| { "port": .PortName?, "conn": .ConnectionFiberlines?[] , "mlayer": .Fiberlines?[]} ' | jq -s ' group_by(.port) | .[]| { port : .[0].port, conn: [
.[].conn],mlayer: [.[].mlayer] } '
Comments