Hey Casey,

That is not currently possible within InfluxQL. As you have found out, the
results are still grouped by measurement.

This is halfway-possible using Kapacitor
<https://github.com/influxdata/kapacitor>, where you can create a stream
that collects points from all measurements by not specifying a
`measurement` in the `from` node. For example:

```
    stream
        |from()
            .database('telegraf')
            .retentionPolicy('autogen')
```

Will collect all points written to the telegraf database (not grouped by
measurement), which would enable you to aggregate fields across all
measurements. At the moment you cannot restrict the measurements with
regex, so I have gone ahead and created a feature request to support this
in the future here <https://github.com/influxdata/kapacitor/issues/823>.
Also, if you haven't already done so, I'd recommend you look into using
Kapacitor as continuous query engine
<https://docs.influxdata.com/kapacitor/v1.0/examples/continuous_queries/>,
which sounds similar to what you're trying to accomplish here.

If you are unable to use Kapacitor, I think modifying your schema will be
your best option.

I hope that helps!

Thanks,
Ross

On Mon, Aug 22, 2016 at 10:42 PM, <[email protected]> wrote:

> Is it possible to perform GROUP BY aggregation across multiple
> measurements, such that they can be selected into a new single measurement?
>
> For example, I'd like to do something like:
>
> SELECT COUNT(value) as h_count, SUM(value) as h_sum, MIN(value) as h_min,
> MAX(value) as h_max INTO hourly FROM /rawdata.*/ GROUP BY time(1h), tag1,
> tag2
>
> The result I'm seeing when I try this leads me to believe the aggregate
> function isn't being applied across all the matched measurements -- just
> within each. Is there a way to aggregate across all of them with InfluxQL?
> If so, how?
>
> If not, I can probably work around this with a different schema, but it
> seems like it'd be a useful thing to be able to do.
>
> Thanks,
> Casey
>
> --
> 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/bfd31c07-f365-43be-9490-6c0552dde624%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAD8sRLCH%3D5m5z_nQfas5E6%3Dcb8hmZGZ0fPfN1Xy7cYzCE7aQtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to