InfluxDB does not support subqueries. It is not possible to pass the
results from one query as the arguments to another.

However, I don't understand what you are trying to accomplish with the
subquery. The SELECT query already defines "hostname ='www.dev.local' AND
sensor_descr='temp2'", and if the subquery worked (and it was a regex
instead of an equality operator), then it would return for all values of
"sensor_index".

Does this query give you what you need?

SELECT mean("sensor") FROM sensor WHERE hostname = 'www.dev.local' AND
sensor_type = 'lmsensors' AND sensor_class = 'temperature' AND sensor_descr
= 'temp2' *GROUP BY sensor_index*

Also, note that queries unbounded in time can quite easily OOM the system.
I highly recommend adding a "WHERE time" clause to the query, e.g.

SELECT mean("sensor") FROM sensor WHERE hostname = 'www.dev.local' AND
sensor_type = 'lmsensors' AND sensor_class = 'temperature' AND sensor_descr
= 'temp2' WHERE time > now() - 5d GROUP BY sensor_index

On Fri, Sep 23, 2016 at 4:37 AM, kmg <[email protected]> wrote:

> Someone please help me on the below query. its not running. Is that
> function not supported in Influxdb  or did I make anything wrong in the
> query syntax ?
>
> SELECT mean("sensor") FROM sensor WHERE hostname = 'www.dev.local' AND
> sensor_type = 'lmsensors' AND sensor_class = 'temperature' AND sensor_descr
> = 'temp2' AND sensor_index = (show tag values from sensor with
> key=sensor_index where hostname ='www.dev.local' AND sensor_descr='temp2')
>
> If I run the above query separately, I can get the output.
>
> Query 1 : show tag values from sensor with key=sensor_index where hostname
> ='www.dev.local' AND sensor_descr='temp2'
> Query 2 : SELECT mean("sensor") FROM sensor WHERE hostname =
> 'www.dev.local' AND sensor_type = 'lmsensors' AND sensor_class =
> 'temperature' AND sensor_descr = 'temp2' AND sensor_index = <OutputOfQuery1>
>
> But I try to combine those two query into single query. Its not running.
> Please help me on this.
>
> Thanks in Advance.
>
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/0093db4b-bf7d-41d2-901e-629fde56ad7f%40googlegroups.com
> <https://groups.google.com/d/msgid/influxdb/0093db4b-bf7d-41d2-901e-629fde56ad7f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvNPV0DpKgbPA4qzgHr4B%3DDRge_6znT6Nppr%3D1CXcW43RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to