Wildcard in Influx Query

Hello all,

I have at the moment a pretty simple problem with a query to an influx DB in Grafana.

My statement is as follows:

SELECT distinct(“VALS_TAG”) FROM “7d”.“machines” WHERE (“topic” = ‘/0200/2500/PRODUCT/TYPE/${Assetnumber}/PC/VALUES/JSON/V0’) AND $timeFilter GROUP BY time($__interval)

My issue is now to set a wildcard for PRODUCT and TYPE. I tried to use “+” and “*” but it doesn’t work:

SELECT distinct(“VALS_TAG”) FROM “7d”.“machines” WHERE (“topic” = ‘/0200/2500/+/+/${Assetnumber}/PC/VALUES/JSON/V0’) AND $timeFilter GROUP BY time($__interval)

How can I make Grafana catch the data just with my Assetnumber, ignoring this PRODUCT and TYPE parts in the topicname?

Thanks in advance for some help!

welcome to the :grafana: forum, @knma

does that sort of regex work when you query influxdb directly? This kind of query help question might be better suited for the influx forum