InfluxDB-CLI
SQL CLI for InfluxDB
Installation
npm install influxdb-cli -g
Screencast
Options
InfluxDB SQL CLIUsage: node ./influxdb-cli Options: -h, --hostname Host [%s] [default: "localhost"] --port Port [%s] [default: 8086] -s, --secure Use HTTPS
Usage
influxdb-cli -d redsmin -u user -p passwordredsmin> Connecting to http://localhost:8086/db/redsmin ...redsmin> ✔ readyredsmin> SELECT used_memory, used_memory_lua, used_memory_peak from info limit 10;┌───────────────┬─────────────────┬─────────────┬─────────────────┬──────────────────┐│ time │ sequence_number │ used_memory │ used_memory_lua │ used_memory_peak │├───────────────┼─────────────────┼─────────────┼─────────────────┼──────────────────┤│ 1383952323268 │ 1300 │ 1889826 │ 31744 │ 1889826 ││ 1383952323258 │ 1299 │ 1889826 │ 31744 │ 1889826 ││ 1383952317262 │ 1298 │ 1889826 │ 31744 │ 1889826 ││ 1383952317254 │ 1297 │ 1889826 │ 31744 │ 1889826 ││ 1383952311270 │ 1296 │ 1963522 │ 31744 │ 1963522 ││ 1383952311261 │ 1295 │ 1963522 │ 31744 │ 1963522 ││ 1383952305260 │ 1294 │ 1926674 │ 31744 │ 1926674 ││ 1383952305253 │ 1293 │ 1926674 │ 31744 │ 1926674 ││ 1383952299261 │ 1292 │ 1889826 │ 31744 │ 1889826 ││ 1383952299257 │ 1291 │ 1889826 │ 31744 │ 1889826 │└───────────────┴─────────────────┴─────────────┴─────────────────┴──────────────────┘redsmin>
With --pretty
activated
influxdb-cli -d redsmin -u user -p password --pretty
redsmin> Connecting to http://localhost:8086/db/redsmin ...
redsmin> ✔ ready
redsmin> SELECT used_memory, used_memory_lua, used_memory_peak from info limit 10;
┌──────────────────┬─────────────────┬─────────────┬─────────────────┬──────────────────┐
│ time │ sequence_number │ used_memory │ used_memory_lua │ used_memory_peak │
├──────────────────┼─────────────────┼─────────────┼─────────────────┼──────────────────┤
│ 9/11/13 12:30:50 │ 1186 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:50 │ 1185 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:44 │ 1184 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:44 │ 1183 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:38 │ 1182 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:38 │ 1181 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:32 │ 1180 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:32 │ 1179 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:26 │ 1178 │ 1889826 │ 31744 │ 1889826 │
│ 9/11/13 12:30:26 │ 1177 │ 1889826 │ 31744 │ 1889826 │
└──────────────────┴─────────────────┴─────────────┴─────────────────┴──────────────────┘
redsmin>
Commands
use [dbname]
: switch to databasedbname
.quit
|exit
: quit the cliping
: send the ping queryversion
: get the database versopm from the connected server.
History
v0.2.0 (25 Nov. 2014)
- [Feature] add new
-auth
option - [Fix] exit as soon as possible fixes #12
v0.1.4 (30 Oct. 2014)
- [Feature] new
ping
andversion
commands #15 by @codyhanson
v0.1.3 (27 Oct. 2014)
- [Feature] Add HTTPS support. #14 by @codyhanson
- [Feature] Show series names #13 by @macbre
- [Fix] Remove error message when just pressing enter #11 by @5outh