0

I have an influxql query used in grafana as follows:

SELECT mean("value") FROM /^concourse\.(worker*|web*).*\.system_mem_percent$/ WHERE $timeFilter GROUP BY time($__interval), * fill(null)

This works as expected, I get only the results of measurements with worker... or web... in it.

I'm trying to now build the inverse query of this. I.E all measurements that do not have worker... or web... in it.

I'll need to be able to do this with regex on measurements itself. (Assume no tags)

How could this be achieved in influxql (influxdb 1.7).

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
Vipin Menon
  • 2,892
  • 4
  • 20
  • 35

1 Answers1

0

It looks like you need negative lookahead in your regexp. But InfluxDB uses Golang’s regular expression syntax, where negative lookahead is not supported.

You may use workaround with more complicated regexp with negated character classes - see Negative look-ahead in Go regular expressions

But I would go with better InfluxDB design and I would use tags. It is also recommended approach https://docs.influxdata.com/influxdb/v1.8/concepts/schema_and_data_layout/#avoid-encoding-data-in-measurement-names

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59