Documentation

influxctl table create

The influxctl table create command creates a new table in the specified database in an InfluxDB Cloud Dedicated 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.

Always provide a time format when using custom partitioning

If defining a custom partition template for your table with any of the --template-* flags, always include the --template-timeformat flag with a time format to use in your partition template. Otherwise, InfluxDB omits time from the partition template and won’t compact partitions.

Usage

influxctl table create [flags] <DATABASE_NAME> <TABLE_NAME>
  • Copy
  • Fill window

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
-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
  • Copy
  • Fill window

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 day using the time format %Y-%m-%d:

influxctl table create \
  --template-tag room \
  --template-tag sensor-type \
  --template-tag-bucket customerID,1000 \
  --template-timeformat '%Y-%m-%d' \
  
DATABASE_NAME
\
TABLE_NAME
  • Copy
  • Fill window

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.

Read more

InfluxDB 3 Core and Enterprise are now in Beta

InfluxDB 3 Core and Enterprise are now available for beta testing, available under MIT or Apache 2 license.

InfluxDB 3 Core is a high-speed, recent-data engine that collects and processes data in real-time, while persisting it to local disk or object storage. InfluxDB 3 Enterprise is a commercial product that builds on Core’s foundation, adding high availability, read replicas, enhanced security, and data compaction for faster queries. A free tier of InfluxDB 3 Enterprise will also be available for at-home, non-commercial use for hobbyists to get the full historical time series database set of capabilities.

For more information, check out: