Get top 5 values from 10 different measurements

Hello Influx Experts,

I am using Influxdb 1.8.3 version.
I want to get the top 5 values of a specific field on 10 different measurements.

I already read top functions, however all examples are just getting top values on a single measurement only, what I want is to get the top 5 value on 10 different measurements.

All my measurements has this kind of structure.

Measuremen1:
field1
Measurement2:
field1
Measurenent3:
field1
Up to Measurement10

So to sum up, I want to get the top 5 values of field1 on different measurements.
I want to view this in grafana Pie Chart Panel.

Is this possible?

Thank you

Regards,
Henjoe

Yes, it’s possible, but some limitations may apply (depending on the measurement name) as you need to use a regex.
Docs here.

SELECT TOP(__FieldName__, 5)
FROM /__RegexHere__/
Where __whatever__

The only other way (I’m aware of) is to write a query for each measurement.

Thanks my friend!

Regards,
Henjoe