Is it possible to query tag values with a where clause thats a field ?
Such as
show tag values from dellsc_san_infos with key=“hostname” where “global_status” = ‘4’
Is it possible to query tag values with a where clause thats a field ?
Such as
show tag values from dellsc_san_infos with key=“hostname” where “global_status” = ‘4’
Hello @ntbritton ,
Yes you can use InfluxQL to filter by tags and fields as described here:
That looks like a select instead of a show keys filtering on a field value.
Its possible
SHOW TAG VALUES FROM "measurement" WITH KEY = "key" WHERE "TagName" = 'TagValue'
I use a smimilar query to filter hosts based on a customer name tag when i apply alerts.
As a point, there is a bug/issue. Depending how much data you collect, eventually the output of SHOW TAGS and SELECT tagname,fieldname are different.
SHOW TAGS does not show all tag values it seems. It was an issue in 1.5.x, I’ve updated to 1.8.3 which should have fixed it, but it has happened again. Because of that we’re looking at switching to using SELECT instead.
In your example the where clause is referencing a tag value, I want to use a field value, do you know if that will work?
My apologies, i misread your initial post. Sorry.
I’ve just tried to query some of my data using a field in the where clause, there are no errors but it doesn’t seem to match anything so it looks like a no.
One other option i can think of is if you have that value as a field, you might be able to insert it as a tag as well - Then you could filter on the tag value, however depending on how many individual values that tag could have might impact the performance of influxdb.
Telegraf has a few processor plugins, they might be worth investigating.
If you know there will only ever be a handful of possible values say ranging from 1 - 5 for example it should be ok, if it could range from between 1 and 999999 then not so good.
Sorry I couldn’t help more.
Not a problem, i apricate it.