Regular expressions
InfluxQL supports using regular expressions when specifying:
- field keys and tag keys in the
SELECT
clause. - measurements in the
FROM
clause. - tag values and string field values in the
WHERE
clause. - tag keys in the
GROUP BY
clause
Regular expressions in InfluxQL only support string comparisons and can only evaluate fields with string values.
Note: Regular expression comparisons are more computationally intensive than exact string comparisons. Queries with regular expressions are not as performant as those without.
Syntax
SELECT /<regular_expression_field_key>/ FROM /<regular_expression_measurement>/ WHERE [<tag_key> <operator> /<regular_expression_tag_value>/ | <field_key> <operator> /<regular_expression_field_value>/] GROUP BY /<regular_expression_tag_key>/
Regular expressions are surrounded by /
characters and use the
Go regular expression syntax.
Supported operators
=~
: matches against
!~
: doesn’t match against
Examples
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.