Skip to content

Instantly share code, notes, and snippets.

@malefs
Forked from tomazursic/InfluxDB_cheatsheet.md
Created September 9, 2020 14:45
Show Gist options
  • Select an option

  • Save malefs/af3ad5be369fd45637040314cf1276b0 to your computer and use it in GitHub Desktop.

Select an option

Save malefs/af3ad5be369fd45637040314cf1276b0 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