I am making an API call to a Netflow collector using an HTTP agent Item in Zabbix, which returns JSON:
{"volume":"179.288 GB","max":"444.324 Mbps","granularity":"10 Minute Average","startTime":"2024-11-22 10:00","endTime":"2024-11-22 11:00","devName":"10.133.14.5","devTraffic":[{"seriesname":"10.133.14.5","data":[[1732269600000,0.4335181612533333],[1732270200000,0.38681981957333333],[1732270800000,0.41928402750666666],[1732271400000,0.4443239848666667],[1732272000000,0.27023713624],[1732272600000,0.43630378266666664],[1732273200000,2.257808E-5]],"yaxiscolumnorder":[0]}],"avgSpeed":"398.418 Mbps","YAxis":"Gbps"}
or
{"volume":"525.727 GB","max":"1.510 Gbps","granularity":"10 Minute Average","startTime":"2024-11-22 10:00","endTime":"2024-11-22 11:00","devName":"10.133.14.4","devTraffic":[{"seriesname":"10.133.14.4","data":[[1732269600000,1.0055900881066666],[1732270200000,0.9072969555066667],[1732270800000,1.1287709371466668],[1732271400000,1.2801433879733333],[1732272000000,1.1733471851866666],[1732272600000,1.51046208856],[1732273200000,0.004088235546666667]],"yaxiscolumnorder":[0]}],"avgSpeed":"1.168 Gbps","YAxis":"Gbps"}
I am only interested in the max speed, so I was running a JSON Path to extract the parameter $.max which works great, except that, as show above, some time its in Gbps and some times its in Mbps. Is there anything I can do in Preprocessing to covert this into a standard?
For example if it is in Gbps convert it to Mbps?
Many thanks in advance
{"volume":"179.288 GB","max":"444.324 Mbps","granularity":"10 Minute Average","startTime":"2024-11-22 10:00","endTime":"2024-11-22 11:00","devName":"10.133.14.5","devTraffic":[{"seriesname":"10.133.14.5","data":[[1732269600000,0.4335181612533333],[1732270200000,0.38681981957333333],[1732270800000,0.41928402750666666],[1732271400000,0.4443239848666667],[1732272000000,0.27023713624],[1732272600000,0.43630378266666664],[1732273200000,2.257808E-5]],"yaxiscolumnorder":[0]}],"avgSpeed":"398.418 Mbps","YAxis":"Gbps"}
or
{"volume":"525.727 GB","max":"1.510 Gbps","granularity":"10 Minute Average","startTime":"2024-11-22 10:00","endTime":"2024-11-22 11:00","devName":"10.133.14.4","devTraffic":[{"seriesname":"10.133.14.4","data":[[1732269600000,1.0055900881066666],[1732270200000,0.9072969555066667],[1732270800000,1.1287709371466668],[1732271400000,1.2801433879733333],[1732272000000,1.1733471851866666],[1732272600000,1.51046208856],[1732273200000,0.004088235546666667]],"yaxiscolumnorder":[0]}],"avgSpeed":"1.168 Gbps","YAxis":"Gbps"}
I am only interested in the max speed, so I was running a JSON Path to extract the parameter $.max which works great, except that, as show above, some time its in Gbps and some times its in Mbps. Is there anything I can do in Preprocessing to covert this into a standard?
For example if it is in Gbps convert it to Mbps?
Many thanks in advance
Comment