I read similar question but not found an answer. I have this data in input:
{ "connectionHistory": [
{
"endTime": 1585571806,
"bytesSent": 31588,
"startTime": 1585571453,
"duration": 353,
"bytesReceived": 68711,
"virtualIpAddress": "10.20.1.102",
"remoteIpAddress": "172.16.15.183"
},
{
"endTime": 1585591333,
"bytesSent": 21927,
"startTime": 1585591095,
"duration": 238,
"bytesReceived": 51041,
"virtualIpAddress": "10.20.1.102",
"remoteIpAddress": "172.16.13.75"
},
{
"endTime": 1585592547,
"bytesSent": 4630423,
"startTime": 1585591333,
"duration": 1214,
"bytesReceived": 678052,
"virtualIpAddress": "10.20.1.102",
"remoteIpAddress": "172.16.13.75"
},
{
"endTime": 1585743727,
"bytesSent": 2153310,
"startTime": 1585743512,
"duration": 215,
"bytesReceived": 499382,
"virtualIpAddress": "10.20.1.102",
"remoteIpAddress": "172.16.12.209"
}
]}
And like to have in output something like:
Start End Duration IP client IP remote Received Sent
01 Apr 2020, 16:13 01 Apr 2020, 16:15 02m 11s 10.20.1.102 5.170.193.103 475.15 K 2.01 M
01 Apr 2020, 14:18 01 Apr 2020, 14:22 03m 35s 10.20.1.102 5.170.192.209 487.68 K 2.05 M
30 Mar 2020, 20:02 30 Mar 2020, 20:22 20m 14s 10.20.1.102 5.170.193.75 662.16 K 4.42 M
30 Mar 2020, 19:58 30 Mar 2020, 20:02 03m 58s 10.20.1.102 5.170.193.75 49.84 K 21.41 K
30 Mar 2020, 14:30 30 Mar 2020, 14:36 05m 53s 10.20.1.102 5.170.195.183 67.1 K 30.85 K
Tried to play with jq, but with no good results ...
Hints appreciated ;-)
Thanks, P.