Documentation

Use Telegraf to dual write to InfluxDB

InfluxDB 3 Enterprise is in Public Beta

InfluxDB 3 Enterprise is in public beta and available for testing and feedback, but is not meant for production use yet. Both the product and this documentation are works in progress. We welcome and encourage your input about your experience with the beta and invite you to join our public channels for updates and to share feedback.

Beta expectations and recommendations

Use Telegraf to write your data simultaneously to multiple InfluxDB instances or clusters. This method, known as “dual writing,” is useful for backing up data to a separate instance or for migrating from other versions of InfluxDB to InfluxDB 3 Enterprise.

The following example configures Telegraf for dual writing to InfluxDB 3 Enterprise and an InfluxDB v2 OSS instance.

  • The InfluxDB v2 output plugin twice–the first pointing to InfluxDB 3 Enterprise and the other to an InfluxDB v2 OSS instance.

  • Two different tokens–one for InfluxDB v2 OSS and one for InfluxDB 3 Enterprise. Configure both tokens as environment variables and use string interpolation in your Telegraf configuration file to reference each environment variable.

    While in beta, InfluxDB 3 Enterprise does not require an authorization token. For the token option, provide an arbitrary, non-empty token string.

Sample configuration

# Include any other input, processor, or aggregator plugins that you want to
# include in your configuration.

# Send data to InfluxDB 3 Enterprise
[[outputs.influxdb_v2]]
  ## The InfluxDB 3 Enterprise URL
  urls = ["http://localhost:8181"]
  ## InfluxDB 3 Enterprise authorization token
  token = "${INFLUX_TOKEN}"
  ## For InfluxDB 3 Enterprise, set organization to an empty string
  organization = ""
  ## Destination database to write into
  bucket = "DATABASE_NAME"

# Send data to InfluxDB v2 OSS
[[outputs.influxdb_v2]]
  ## The InfluxDB v2 OSS URL
  urls = ["http://localhost:8086"]
  ## OSS token for authentication
  token = "${INFLUX_TOKEN_OSS}"
  ## Organization is the name of the organization you want to write to.
  organization = "ORG_NAME_OSS"
  ## Destination bucket to write to
  bucket = "BUCKET_NAME_OSS"
  • Copy
  • Fill window

Telegraf lets you dual write data to any version of InfluxDB using the influxdb (InfluxDB v1) and influxdb_v2 output plugins. A single Telegraf agent sends identical data sets to all target outputs. You cannot filter data based on the output.

InfluxDB v1 does not support the unsigned integer data type. You can only write unsigned integer field values to InfluxDB v2- and 3-based products.


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: