Influxdb: Cannot exclude results that dont have a specific tag from query

Created on 26 Jun 2015  路  2Comments  路  Source: influxdata/influxdb

We have three series with the following tag and measurement name :

MeasurementA : host_name = H1, service_description = S1
MeasurementA : host_name = H1
MeasurementB : host_name = H1

I would like to query all points of measurement A and B, where host_name is H1 and that the service_description tag is not present.

Most helpful comment

Just to document on this issue, had the same problem and using /.*/ did not work, what did work was using /./

All 2 comments

@fpeyre it's possible with negation and regex:

SELECT * FROM /Measurement.*/ WHERE host_name = 'H1' AND service_description !~ /.*/

Note that in order to select from multiple measurements, they must share an identical set of field keys. Otherwise the system will give an error ERR: unknown field or tag name in select clause: <fkey> where <fkey> will be the field key that does not exist on all measurements matched by the query.

Just to document on this issue, had the same problem and using /.*/ did not work, what did work was using /./

Was this page helpful?
0 / 5 - 0 ratings

Related issues

udf2457 picture udf2457  路  3Comments

Witee picture Witee  路  3Comments

affo picture affo  路  3Comments

Raniz85 picture Raniz85  路  3Comments

dtouzeau picture dtouzeau  路  3Comments