Hello,
the following statement calculates the throughput in bps for a couple of ports of a switch monitored via snmp (derivative is necessary because the counter is a never decreasing one). How could I sum up the throughput of two or more ports?
Thanks.
from(bucket: “bucket1”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == “snmp-ifcounters”)
|> filter(fn: (r) => r["_field"] == “ifHCOutOctets”)
|> filter(fn: (r) => r[“agent_host”] == “switch1” and (r[“ifName”] == “Te1/0/20” or r[“ifName”] == “Te1/0/21”))
|> derivative(unit: 1s, nonNegative: true)
|> map(fn: (r) => ({ r with _value: r._value * 8.0 }))