devm
devm

Reputation: 227

How to return specific rows from InfluxDB measurement when the column contains a string value

Basically, I am looking for an equivalent of "LIKE" keyword as in SQL. Is there any way we can get those rows where column contains specific string?

For e.g. from below table/measurement, can we get the row where column "data" contains "find"? i.e. 2nd row.

Col1          Col2              Col3
first str     second str      third str
first str     second str      third str, find me
first str     second str      third str

Upvotes: 1

Views: 830

Answers (1)

Mark Wragg
Mark Wragg

Reputation: 23355

You can use the =~ operator to compare to a regex. Eg:

select * from yourmeasure where col3 =~ /find/i

The i makes it case insensitive. Remove this if you don't want it.

Upvotes: 3

Related Questions