Hello everyone,
I have a problem with my data. My data separates the value as ‘‘1’’ and ‘‘2’’ and I changed it ‘‘UP’’ and ‘‘DOWN’’ . ‘‘UP’’ symbolizes ‘‘1’’ and ‘‘DOWN’’ symbolizes ‘‘2’’. My question is how can add my values like how much ‘‘1’’ I have and ‘‘2’’ I have ? I wrote one script but it ‘‘1’’ and ‘‘2’’ separately not together.
Here is my script that I mentioned for InfluxDB;
from(bucket: “telegraf”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“agent_host”] == “192.168.0.10”)
|> filter(fn: (r) => r[“_field”] == “ifOperStatus.1” or r[“_field”] == “ifOperStatus.10” or r[“_field”] == “ifOperStatus.2” or r[“_field”] == “ifOperStatus.3” or r[“_field”] == “ifOperStatus.4” or r[“_field”] == “ifOperStatus.5” or r[“_field”] == “ifOperStatus.6” or r[“_field”] == “ifOperStatus.7” or r[“_field”] == “ifOperStatus.8” or r[“_field”] == “ifOperStatus.9”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)
Here is my grafana dashboard. I want to see total number of ‘‘UP’’ and ‘‘DOWN’’ I shared both maybe there is a problem in my script ad I have to add something to calculate my datas or perhaps I need to create something inside of grafana. Therefore, I shared both.
Thank you in advance,