Documentation

Use Telegraf to dual write to InfluxDB

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 Core.

The following example configures Telegraf for dual writing to InfluxDB 3 Core and an InfluxDB v2 OSS instance. Specifically, it uses the following:

  • The InfluxDB v2 output plugin twice–the first pointing to InfluxDB 3 Core and the other to an InfluxDB v2 OSS instance.
  • Two different tokens–one for InfluxDB v2 OSS and one for InfluxDB 3 Core. Configure both tokens as environment variables and use string interpolation in your Telegraf configuration file to reference each environment variable.

Sample configuration

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

# Send data to InfluxDB 3 Core
[[outputs.influxdb_v2]]
  ## The InfluxDB 3 Core URL
  urls = ["http://localhost:8181"]
  ## InfluxDB 3 Core authorization token
  token = "${INFLUX_TOKEN}"
  ## For InfluxDB 3 Core, 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"

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!


New in InfluxDB 3.5

Key enhancements in InfluxDB 3.5 and the InfluxDB 3 Explorer 1.3.

See the Blog Post

InfluxDB 3.5 is now available for both Core and Enterprise, introducing custom plugin repository support, enhanced operational visibility with queryable CLI parameters and manual node management, stronger security controls, and general performance improvements.

InfluxDB 3 Explorer 1.3 brings powerful new capabilities including Dashboards (beta) for saving and organizing your favorite queries, and cache querying for instant access to Last Value and Distinct Value caches—making Explorer a more comprehensive workspace for time series monitoring and analysis.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On November 3, 2025, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2