influxdb-cli icon indicating copy to clipboard operation
influxdb-cli copied to clipboard

Supplying queries on the command line

Open jessereynolds opened this issue 10 years ago • 1 comments

It'd be nice to be able to supply queries on the command line, for saved one liners that will execute an influxdb query and then exit. Does this make sense? Eg something like:

influxdb-cli db --host influxdb.example \
  --pretty --database test --time-precision u \
  'select count(path) from /.*collectd.*/ where time > now() - 1h group by time(5m);'

Perhaps it would need a flag eg --query 'select ...'

jessereynolds avatar Dec 23 '14 00:12 jessereynolds

Or feed a set of queries in via stdin eg:

cat influxdb_queries.txt | influxdb-cli ... 

jessereynolds avatar Dec 23 '14 00:12 jessereynolds