Querying for tag values in a given list

无人久伴 提交于 2019-11-30 23:09:06

问题


Is there any shortform syntax in influxdb to query for membership in a list? I'm thinking of something along the lines of

SELECT * FROM some_measurement WHERE some_tag IN ('a', 'b', 'c')

For now I can string this together using ORed =s, but that seems very inefficient. Any better approaches? I looked through the language spec and I don't see this as a possibility in the expression productions.

Another option I was thinking was using the regex approach, but that seems like a worse approach to me.


回答1:


InfluxDB 0.9 supports regex for tag matching. It's the correct approach although of course regex can be problematic. It's not a performance issue for InfluxDB, and in fact would likely be faster than multiple chained OR statements. There is no support yet for clauses like IN or HAVING.

For example: SELECT * FROM some_measurement WHERE some_tag =~ /a|b|c/



来源:https://stackoverflow.com/questions/32063055/querying-for-tag-values-in-a-given-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!