Hey!

I'm looking for a way to create continuous queries at the time of db create. 
Here is what I'm trying to do with collectd and other measurements.

create database "collectd" <- this creates the db based on the specs set by the 
parameter typesdb

[[collectd]]
  enabled = true
  bind-address = ":25826"
  database = "collectd"
  typesdb = "/usr/share/collectd/types.db"


Now I've to execute the create continuous query command after this is created. 
I know once I have a working query I don't need to recreate it. But I've to, at 
times drop and recreate the collectd db (I'm using tmpfs here :p), or deploy 
influxdb/collectd/grafana on a new set of environments. 

I went through the docs and couldn't find anything that will help.

Has anyone attempted this?

Following is one of the few continuous queries I'm creating. They work well, 

CREATE CONTINUOUS QUERY "net_rx" ON collectd BEGIN SELECT 
non_negative_derivative(max("value"), 1s) INTO "netread" FROM "interface_rx" 
WHERE "type" = 'if_octets' AND "instance" = 'eth0' GROUP BY time(10s) END

CREATE CONTINUOUS QUERY "net_tx" ON collectd BEGIN SELECT 
-1*non_negative_derivative(max("value"), 1s) INTO "netwrite" FROM 
"interface_rx" WHERE "type" = 'if_octets' AND "instance" = 'eth0' GROUP BY 
time(10s) END

-- 
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/f1e70497-45b3-472b-a07f-e8b1fe388e25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to