According to the docs, we can...
Use a regular expression to specify a tag with a value in the WHERE clause.
When I query my influxdb like this, I get the desired results.
> SELECT "field" FROM "measurement" WHERE tag = 19
😀
When replacing the where filtering by a regex, however, I get no results.
> SELECT "field" FROM "measurement" WHERE tag =~ /19/
😕
Can someone tell me why that is?
To perform an InfluxQL query, send a GET request to the /query endpoint, set the URL parameter db as the target database, and set the URL parameter q as your query. You can also use a POST request by sending the same parameters either as URL parameters or as part of the body with application/x-www-form-urlencoded .
InfluxQL lets you group by tags or by time intervals, but nothing else. Flux lets you group by any column in the dataset, including _value . Use the Flux group() function to define which columns to group data by.
InfluxQL is an SQL-like query language for interacting with data in InfluxDB. The following sections detail InfluxQL's SELECT statement and useful query syntax for exploring your data.
Found the mistake myself...
I had both a field and a tag with the same key. So I was doing
> SELECT "filed_key" from "measurement" WHERE field_key =~ /val/
Now I have changed my schema so that keys across fields and tags are unique, and everything works as expected.
There's also a discussion about this phenomenon on github.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With