Skip to content

Instantly share code, notes, and snippets.

@tomazursic
Last active December 24, 2021 08:46
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save tomazursic/6cc217e2644c619ceceefb8ce824925b to your computer and use it in GitHub Desktop.
Save tomazursic/6cc217e2644c619ceceefb8ce824925b to your computer and use it in GitHub Desktop.
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