I would like to use the node.js
module for querying my telegraf
data in influxdb
. However I just can’t figure out how to do it, and don’t see any relevant documentation.
How does one write a query for influx.query( ... )
that would do something like
curl "http://my.influxdb.instance:8086/query?db=telegraf" --data-urlencode 'q=SELECT * FROM "cpu" WHERE "host"=$machine AND "cpu"=$cpu' --data-urlencode 'params={"machine":"${NAME}","cpu":"cpu-total"}'
This specific query returns data in my bash
shell.
My guess is something like
influx.query(`
select * from cpu
where host = ${name}
and cpu = cpu-total
`)
but this returns no data.