You can either do it as a tag or an explicit where clause based on the
customer.
Where clause:
CREATE CONTINUOUS QUERY "cq_basic" ON "transportation"
BEGIN
SELECT mean("passengers") INTO "average_passengers" FROM "bus_data"
WHERE customer = "test" GROUP BY time(1h)
END
Tag:
CREATE CONTINUOUS QUERY "cq_basic" ON "transportation"
BEGIN
SELECT mean("passengers") INTO "average_passengers" FROM "bus_data"
GROUP BY customer, time(1h)
END
--
Kind Regards,
Dan Offord
DevOps
Multiplay (UK) Ltd, Unit 7 Whitefield, Lepe Road, Blackfield
Southampton, Hampshire, SO45 1XR
Registered in England & Wales No. 3370594
www: multiplay.com | www.multiplayevents.com
Twitter: @liv3d <http://twitter.com/liv3d>| Skype: mpukliv3d | LinkedIn
<http://uk.linkedin.com/in/danofford/>
On 7 February 2017 at 10:42, Claus Koell <[email protected]> wrote:
> Hi ..
>
> Is it possible to create a continuous query and insert a fix tag value ?
>
> Example:
>
> CREATE CONTINUOUS QUERY "cq_basic" ON "transportation"
> BEGIN
> SELECT mean("passengers") INTO "average_passengers" FROM "bus_data" GROUP
> BY time(1h)
> END
>
>
> Now i want to insert a tag value like customer=test to the inserted lines
> ...
>
> Is this possible ?
>
> greets
> claus
>
> --
> Remember to include the version number!
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxData" 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/92e6a1ca-777b-41b7-a081-91e30747405b%40googlegroups.com
> <https://groups.google.com/d/msgid/influxdb/92e6a1ca-777b-41b7-a081-91e30747405b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups
"InfluxData" 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/CA%2BwvyisANNXxxwi-f%2BG4eWJTJxkQa9ZweE-bHb2sLBLv%3DFZE8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.