kromm77

[jq] group by

Feb 26th, 2018 (edited)
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.21 KB | None | 0 0
  1. jq    '.FiberSwitchPorts[]|  { "port": .PortName?,  "conn": .ConnectionFiberlines?[] ,  "mlayer": .Fiberlines?[]}  ' | jq -s ' group_by(.port) | .[]| { port : .[0].port, conn: [
  2. .[].conn],mlayer: [.[].mlayer] } '
Add Comment
Please, Sign In to add comment