---
title: Configure Telegraf to write to InfluxDB 3 Enterprise
description: Update existing or create new Telegraf configurations to use the influxdb_v3 output plugin to write to InfluxDB 3 Enterprise. Start Telegraf using the custom configuration.
url: https://docs.influxdata.com/influxdb3/enterprise/write-data/use-telegraf/configure/
estimated_tokens: 2259
product: InfluxDB 3 Enterprise
version: enterprise
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb3/enterprise/write-data/use-telegraf/configure/
date: '2026-07-30T10:56:57-06:00'
lastmod: '2026-07-30T10:56:57-06:00'
---

Use the Telegraf [`influxdb_v3` output plugin](/telegraf/v1/output-plugins/influxdb_v3/)to collect and write metrics to InfluxDB 3 Enterprise.
This plugin uses the InfluxDB 3 Enterprise native HTTP API[`/api/v3/write_lp` endpoint](/influxdb3/enterprise/write-data/http-api/v3-write-lp/)and requires **Telegraf 1.38 or greater**.
Learn how to enable and configure the `influxdb_v3` output plugin to write data
to InfluxDB 3 Enterprise.

If you use an earlier version of Telegraf or bring an existing Telegraf
configuration from InfluxDB v1 or v2, you can use the[`influxdb_v2`](#use-the-influxdb-v2-output-plugin) or[`influxdb`](#use-the-influxdb-v1-output-plugin) (v1) output plugins to write
to InfluxDB 3 Enterprise[compatibility APIs](/influxdb3/enterprise/write-data/http-api/compatibility-apis/).

> [!Note]
> *View the [requirements](/influxdb3/enterprise/write-data/use-telegraf#requirements)for using Telegraf with InfluxDB 3 Enterprise.*

* [Configure Telegraf input and output plugins](#configure-telegraf-input-and-output-plugins)
  * [Add Telegraf plugins](#add-telegraf-plugins)
  * [Collect Prometheus metrics](#collect-prometheus-metrics)
  * [Enable and configure the InfluxDB v3 output plugin](#enable-and-configure-the-influxdb-v3-output-plugin)
    * [urls](#urls)
    * [token](#token)
    * [database](#database)
    * [Additional plugin options](#additional-plugin-options)

  * [Use the InfluxDB v2 output plugin](#use-the-influxdb-v2-output-plugin)
  * [Use the InfluxDB v1 output plugin](#use-the-influxdb-v1-output-plugin)
  * [Other Telegraf configuration options](#other-telegraf-configuration-options)

* [Start Telegraf](#start-telegraf)

## Configure Telegraf input and output plugins

Configure Telegraf input and output plugins in the Telegraf configuration file
(typically named `telegraf.conf`).
Input plugins collect metrics.
Output plugins define destinations where metrics are sent.

This guide assumes you have already [installed InfluxDB 3 Enterprise](/influxdb3/enterprise/install/)and have been through the [getting started guide](/influxdb3/enterprise/get-started/).

### Add Telegraf plugins

To add any of the available [Telegraf plugins](/telegraf/v1/plugins/), follow
the steps below.

1. Find the plugin you want to enable from the complete list of available[Telegraf plugins](/telegraf/v1/plugins/).
2. Click **View** to the right of the plugin name to open the plugin page on GitHub.
   For example, view the [MQTT plugin GitHub page](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/mqtt_consumer/README.md).
3. Copy and paste the example configuration into your Telegraf configuration file
   (typically named `telegraf.conf`).

### Collect Prometheus metrics

If you collect Prometheus metrics with the[`prometheus` input plugin](/telegraf/v1/input-plugins/prometheus/), set`metric_version = 1`.
If you accept pushed Prometheus data with a listener plugin, such as[`http_listener_v2`](/telegraf/v1/input-plugins/http_listener_v2/), set`prometheus_metric_version = 1` for the `prometheus` and`prometheusremotewrite` data formats, or `openmetrics_metric_version = 1`for the `openmetrics` data format.
These data formats default to version `2`.

```toml
[[inputs.prometheus]]
  urls = ["http://localhost:9100/metrics"]
  metric_version = 1

[[inputs.http_listener_v2]]
  service_address = ":1234"
  paths = ["/receive"]
  data_format = "prometheusremotewrite"
  prometheus_metric_version = 1
```

Metric version `2` writes every Prometheus metric name as a separate field in
a single table.
In InfluxDB 3 Enterprise, that produces a[wide](/influxdb3/enterprise/write-data/best-practices/schema-design/#avoid-wide-schemas),[sparse](/influxdb3/enterprise/write-data/best-practices/schema-design/#avoid-sparse-schemas)table that slows persistence and queries.
Metric version `1` writes each Prometheus metric to its own table.
For details, see[Choose a metric version](/telegraf/v1/examples/scrape-prometheus/#choose-a-metric-version)in the Telegraf documentation.

### Enable and configure the InfluxDB v3 output plugin

To send data to InfluxDB 3 Enterprise, enable the[`influxdb_v3` output plugin](/telegraf/v1/output-plugins/influxdb_v3/)in the `telegraf.conf`.

```toml
[[outputs.influxdb_v3]]
  urls = ["http://localhost:8181"]
  token = "AUTH_TOKEN"
  database = "DATABASE_NAME"
```

Replace the following:

* `DATABASE_NAME`:
  the name of the database to write data to
* `AUTH_TOKEN`:
  your InfluxDB 3 Enterprise [token](/influxdb3/enterprise/admin/tokens/).*Store this in a secret store or environment variable to avoid exposing the raw token string.*

The InfluxDB v3 output plugin configuration contains the following options:

#### urls

An array of URL strings.
To write to InfluxDB 3 Enterprise, include your InfluxDB 3 Enterprise URL:

```toml
["http://localhost:8181"]
```

If you specify multiple URLs, Telegraf randomly selects one of them for each
write interval and fails over to another if the write doesn’t succeed.

#### token

Your InfluxDB 3 Enterprise authorization token.

> [!Tip]
> ##### Store your authorization token as an environment variable
>
> To prevent a plain text token in your Telegraf configuration file, we
> recommend that you store the token as an environment variable and then
> reference the environment variable in your configuration file using string
> interpolation. For example:
>
> ```
> [[outputs.influxdb_v3]]
> urls = ["http://localhost:8181"]
> token = "${INFLUX_TOKEN}"
> # ...
> ```

#### database

The name of the InfluxDB 3 Enterprise database to write data to.

#### Additional plugin options

The plugin provides additional options for controlling write behavior,
including:

* **`database_tag`**: the metric tag to use to determine the destination
  database, overriding `database`.
* **`sync`**: set to `false` to acknowledge writes before WAL persistence
  completes, which reduces write latency but increases the risk of data loss.
  Default is `true`.*See [Use no\_sync for immediate write responses](/influxdb3/enterprise/write-data/http-api/v3-write-lp/#use-no_sync-for-immediate-write-responses).*
* **`content_encoding`**: the plugin compresses write request bodies with gzip
  by default.

For all plugin options, see the[`influxdb_v3` output plugin](/telegraf/v1/output-plugins/influxdb_v3/) reference.

### Use the InfluxDB v2 output plugin

If you bring an existing InfluxDB v2 write workload or use a Telegraf version
earlier than 1.38, use the[`influxdb_v2` output plugin](/telegraf/v1/output-plugins/influxdb_v2/)to write to InfluxDB 3 Enterprise through the InfluxDB[v2 compatibility API](/influxdb3/enterprise/write-data/http-api/compatibility-apis/#influxdb-v2-compatibility).

```toml
[[outputs.influxdb_v2]]
  urls = ["http://localhost:8181"]
  token = "AUTH_TOKEN"
  organization = ""
  bucket = "DATABASE_NAME"
```

Replace the following:

* `DATABASE_NAME`:
  the name of the database to write data to
* `AUTH_TOKEN`:
  your InfluxDB 3 Enterprise [token](/influxdb3/enterprise/admin/tokens/)

For InfluxDB 3 Enterprise, set the following v2-specific options:

* **`organization`**: set to an empty string (`""`).
* **`bucket`**: the name of the database to write data to.

> [!Note]
> An InfluxDB v2 ***bucket*** is synonymous with an InfluxDB 3 Enterprise ***database***.

### Use the InfluxDB v1 output plugin

If you bring an existing InfluxDB v1 write workload, use the[`influxdb` output plugin](/telegraf/v1/output-plugins/influxdb/)to write to InfluxDB 3 Enterprise through the InfluxDB[v1 compatibility API](/influxdb3/enterprise/write-data/http-api/compatibility-apis/#influxdb-v1-compatibility).

```toml
[[outputs.influxdb]]
  urls = ["http://localhost:8181"]
  database = "DATABASE_NAME"
  skip_database_creation = true
  username = "ignored"
  password = "AUTH_TOKEN"
```

Replace the following:

* `DATABASE_NAME`:
  the name of the database to write data to
* `AUTH_TOKEN`:
  your InfluxDB 3 Enterprise [token](/influxdb3/enterprise/admin/tokens/)

For InfluxDB 3 Enterprise, set the following v1-specific options:

* **`skip_database_creation`**: set to `true`.
  InfluxDB 3 Enterprise doesn’t support creating databases through the v1 API.
* **`password`**: your authorization token.
  The v1 compatibility API authenticates with the token passed as the password
  credential and ignores `username`.

### Other Telegraf configuration options

For more plugin configuration options, see the[`influxdb_v3`](/telegraf/v1/output-plugins/influxdb_v3/),[`influxdb_v2`](/telegraf/v1/output-plugins/influxdb_v2/), and[`influxdb` (v1)](/telegraf/v1/output-plugins/influxdb/) output plugin
references.

## Start Telegraf

Start the Telegraf service using the `--config` flag to specify the location of
your `telegraf.conf`.

```sh
telegraf --config /path/to/custom/telegraf.conf
```

#### Related

* [Telegraf plugins](/telegraf/v1/plugins/)
* [Telegraf InfluxDB v3 output plugin](/telegraf/v1/output-plugins/influxdb_v3/)

[telegraf](/influxdb3/enterprise/tags/telegraf/)
