Creating tables in InfluxDB via Terminal

InfluxDB doesn't really have the concept of a table. Data is structured into series, which is composed of measurements, tags, and fields.

Measurements are like buckets.

Tags are indexed values.

Fields are the actual data.

Data is written into InfluxDB via line protocol. The structure of line protocol is as follows

<measurement>,<tag>[,<tags>] <field>[,<field>] <timestamp>

An example of a point in line protocol:

weather,location=us-midwest temperature=82 1465839830100400200

To insert data into the database you'll need to issue an HTTP POST request to the /write endpoint, specifying the db query parameter.

For example:

curl -XPOST http://localhost:8086/write?db=mydb --data-binary "weather,location=us-midwest temperature=82 1465839830100400200"

For more information see the Getting Started section of the InfluxDB docs.


I just want to quote the moderator of the influxdata community here:

You can think of

  • measurements as tables in SQL,
  • tags as indexed columns,
  • and fields as unindexed columns