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 I have to add something to calculate my datas or perhaps I need to create something inside of grafana. Therefore, I shared both.
Firstly, I appreciate for your help. I tried this query but nothing is changed. Here is the picture that I tried and I got this warning that is located left side of the picture;
It did not calculate how much ‘‘UP’’ and ‘‘DOWN’’ I have. I want this result in fact. There are 4 ‘‘DOWN’’ and 6 ‘‘UP’’. I want to see this in the chart becuase I will use it for the further things.
In the pie chart visualization settings, you will need to specify which columns from the query results to use as the data for the pie chart. In this case, you will want to use the count_1 and count_2 columns as the data for the pie chart.
I tried like you said. Normally, I write it down in InfluxDb that copy to my grafana. I think there is problem with format because I got some errors when I write InfluxDB. Here is the picture that I got the error.
These datas are the situation of our interfaces and consist of 10 datas, namely ifOperStatus.1 , 2, 3 … 10. Some of them are DOWN status and some of them are UP status. All I want to do that I count how much ‘‘DOWN’’ and ‘‘UP’’. I got some recommedation from @usamaaltaf420 , however we could not resolve it due to format of script.
It does not matter how much you have. However,it matters when you have 1k because especially customer want to see total number of status. I used elactic search before and I can categorize easily how much ‘‘UP’’ and ‘‘DOWN’’ I have. I think it should be easy but I looked every side of grafana and script however I could not resolve it.
Hello, i tested it and it did not work. However, if you have free time, we can work on that together via teams or zoom because I work at home except Tuesday and Thursday. We can arrange a time if you wish.