Documentation

influxctl table create

Limited availability

InfluxDB Clustered is currently only available to a limited group of InfluxData customers. If interested in being part of the limited access group, please contact the InfluxData Sales team.

The influxctl table create command creates a new table in the specified database in an InfluxDB cluster.

Custom partitioning

You can override the default partition template (the partition template of the target database) with the --template-tag, --template-tag-bucket, and --template-timeformat flags when you create the table. Provide a time format using Rust strftime, partition by specific tag, or partition tag values into a specified number of “buckets.” Each of these can be used as part of the partition template. Be sure to follow partitioning best practices.

Usage

influxctl table create [flags] <DATABASE_NAME> <TABLE_NAME>

Arguments

ArgumentDescription
DATABASE_NAMEName of the target database
TABLE_NAMETable name

Flags

FlagDescription
--template-tagTag to add to partition template (can include multiple of this flag)
--template-tag-bucketTag and number of buckets to partition tag values into separated by a comma–for example: tag1,100 (can include multiple of this flag)
--template-timeformatTimestamp format for partition template (default is %Y-%m-%d)
-h--helpOutput command help

Examples

In the following examples, replace:

  • DATABASE_NAME: The name of the database to create the table in.
  • TABLE_NAME : The name of table to create.

Create a table

influxctl table create 
DATABASE_NAME
TABLE_NAME

Create a table with a custom partition template

The following example creates a new table and applies a partition template that partitions by two tags (room and sensor-type) and by week using the time format %Y wk:%W:

influxctl table create \
  --template-tag room \
  --template-tag sensor-type \
  --template-tag-bucket customerID,1000 \
  --template-timeformat '%Y wk:%W' \
  
DATABASE_NAME
\
TABLE_NAME

For more information about custom partitioning, see Manage data partitioning.

View command updates


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Flux is going into maintenance mode and will not be supported in InfluxDB 3.0. This was a decision based on the broad demand for SQL and the continued growth and adoption of InfluxQL. We are continuing to support Flux for users in 1.x and 2.x so you can continue using it with no changes to your code. If you are interested in transitioning to InfluxDB 3.0 and want to future-proof your code, we suggest using InfluxQL.

For information about the future of Flux, see the following: