Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
InfluxDB cheatsheet

InfluxDB Cheatsheet

Connect to InfluxDB using the commandline:

$ influx

Create a database foo:

CREATE DATABASE foo

List the databases:

SHOW DATABASES

Select the new created database:

USE foo

List measurements

SHOW MEASUREMENTS

Show measurements for name: mars

SELECT * FROM mars

Drop mars measurements

DROP MEASUREMENT mars

Show field keys

SHOW FIELD KEYS FROM "mars-A6"

Get power records from measurement with tag and time range

SELECT "power" FROM "drilling" WHERE ("module_id"='rover') AND time >= now() - 9h

Show series

SHOW SERIES

Drop all series for tag

DROP SERIES FROM "drilling" WHERE ("module_id" = 'oppy')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.