Skip to content

Instantly share code, notes, and snippets.

@tomazursic
Last active June 25, 2024 16:02
Show Gist options
  • 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