Hi eveyone,
I am new to grafana and InfluxDB but trying to make my first dashboards.
I have made som dashboards with some of the data i have collected but for some reason I am unable to filter it as i want. I have looked through the documentation and ask different AI’s but am now stuck and cannot get my flux query to work as i want.
from(bucket: "HomeData")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "speedtest")
|> filter(fn: (r) => r["server_ip"] == "212.242.34.104")
Whenever I run the query the result is: 0 series returned
But when I comment out the last line I get all the date in the table:
Could someone please help me in the right direction to figure out why I cannot filter on server_ip or server_id for that matter?
hello @fatman00hotgrafana Welcome to grafana community
please try below query
from(bucket: “HomeData”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “speedtest”)
|> pivot(rowKey:[“_time”], columnKey: [“_field”], valueColumn: “_value”)
|> filter(fn: (r) => r[“server_ip”] == “212.242.34.104”)
or
also check field name server_ip
Please take same query and run it in influxdb query tool. What happens
Hi @infofcc3 ,
Thank you. The query is now giving me a table with the data in it, but I am not able to graph it.
As you can see in this screengrab Query B(top) does not return any rows, but query A(bottom) does:
Could you explain to me why I need the pivot to be able to filter the data, I do not understand that and cannot find an good explanation on why my initial query should not work according to the documentation?