Hey,
Currently using Influx 2 as our TimeSeries Database in a network monitoring project. In that sense, I’m currently querying a switch for all the states of the interfaces. The query returns a table per interface, with the _value
field set to UP|DOWN|NOT PRESENT
.
Another field stores the interface value: InterfaceX/Y
.
For some simple monitoring, I’d just like to get a table, which will be used to plot a graph (x-axis = time, y-axis = amount) that just counts the amount of UP
states for a given timestamp.
I get data every 10 seconds and the timestamps match, I have tried to combine the data with transforms, but so far this has been fruitless.
However, attached is the “debug version” of the transform which shows that perhaps all my data is actually a single table? Imgur: The magic of the Internet
When I run a query as such, I get relatively close, but not really my end goal.
from(bucket:"telemetry")
|> range(start: -1h)
|> filter(fn: (r) => r._value == "UP")
|> group()
|> window(period: 10s)
|> count()
I get all the different timeslots with the _value having the actual number. But how it gets there, or how I continue to format this so it could be used as a neat graph would be quite helpful. Imgur: The magic of the Internet
Any suggestions would be extremely helpful, especially since swapping the group(), count(), and window() with places instantly gives completely different data.
Any and all clarifications and help are welcome.