Hi I have some queries like this,
from(bucket: "rb5009")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "interface")
|> filter(fn: (r) => r["ifDescr"] == "wan1")
|> filter(fn: (r) => r["_field"] == "ifOutOctets")
|> increase()
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "download_data")
from(bucket: "rb5009")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "interface")
|> filter(fn: (r) => r["ifDescr"] == "wan1")
|> filter(fn: (r) => r["_field"] == "ifInOctets")
|> increase()
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "upload_data")
which output some data that looks like this
ifOutOctets {agent_host="10.0.50.1", host="influxdb", ifDescr="wan1", ifIndex="29"}
ifOutOctets {agent_host="10.0.50.1", host="influxdb", ifDescr="wan1", ifIndex="31"}
ifInOctets {agent_host="10.0.50.1", host="influxdb", ifDescr="wan1", ifIndex="29"}
ifInOctets {agent_host="10.0.50.1", host="influxdb", ifDescr="wan1", ifIndex="31"}
The _value
here is an integer and the query calculates data used by computing the difference between previous value and current value in the window.
I reset the interface which is why it’s counter reset and it’s ifIndex changed.
Is there a way to merge this data and keep the graph look nice ?
Currently the graph looks like this