Hi,
I face right now the problem, that I want to perform a query, that exclude some specific combinations of multiple tags.
So for example I have the following situation
Measurement: ipmi_sensor
Tags: server, name, status_desc
Fields: value
I have now for example three servers A, B and C, where A has disk0, B disk1 and C disk0 and disk1
The ipmi_sensor input plugin reads for A, B and C a value for disk0 and disk1, where they have the following combinations of tags
server: name:status_code:value
A: disk0:ok:0
A: disk1:ns:0
B: disk0:ns:0
B: disk1:ok:0
C: disk0:ok:0
C: disk1:ns:0
i want now to create a querry, that only returns C:disk1:ns:0. Since this is a present disk, that failed.
I in A and B there are missing disks, so ns is a valid output, that shouldn’t be shown.
I tried the following query, but it didn’t worked, since the evaluation within the where section isn’t performed with respect to the brackets.
SELECT mean("value") AS "mean_value" FROM "db_server"."autogen"."ipmi_sensor" WHERE time > :dashboardTime: AND ("status_code"='lnr' OR "status_code"='lnc' OR "status_code"='ns') and ("name"='disk0' or "name"='disk1') and ("server"!='A' and "name"!='disk1' and "status_code"!='ns') and ("server"!='B' and "name"!='disk1' and "status_code"!='ns') GROUP BY time(5m), "server", "name", "status_code", "status_desc" FILL(null)
I added “status_code”!=‘ns’ since I wanted to also got a notification if somebody placed a disk into a wrong disk slot.
It would be great to get some advice how to achieve this. I was not able to find any documentation or examples to this question right now.
Later on, I have to add dozens of such combinations. Nevertheless, it seems valuable to me, since the exceptions are only a very small faction of the whole set of combinations.
Best Regards,
Stephan