---
title: Automatically configure Telegraf
description: Use the InfluxDB UI to automatically generate a Telegraf configuration, then start Telegraf using the generated configuration file.
url: https://docs.influxdata.com/influxdb/v2/write-data/no-code/use-telegraf/auto-config/
estimated_tokens: 1219
product: InfluxDB OSS v2
version: v2
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb/v2/write-data/no-code/use-telegraf/auto-config/
date: '2023-11-06T15:53:12-07:00'
lastmod: '2023-11-06T15:53:12-07:00'
---

This page documents an earlier version of InfluxDB OSS.[InfluxDB 3 Core](/influxdb3/core/) is the latest stable version.

#### API token hashing is enabled by default in InfluxDB OSS 2.9.0

Stronger token security: tokens are stored as hashes on disk, so a
copy of the database file doesn’t expose usable tokens. Existing
tokens are hashed on first startup and the original strings can’t
be recovered afterward — **capture any plaintext tokens you still
need before you upgrade**.

For more information, see [Token hashing](/influxdb/v2/admin/tokens/#token-hashing).

The InfluxDB user interface (UI) can automatically create Telegraf configuration files based on user-selected Telegraf plugins.
This article describes how to create a Telegraf configuration in the InfluxDB UI and
start Telegraf using the generated configuration file.

> [!Note]
> *View the [requirements](/influxdb/v2/write-data/no-code/use-telegraf#requirements)for using Telegraf with InfluxDB 2.9.*

## Create a Telegraf configuration

1. Open the InfluxDB UI *(default: [localhost:8086](http://localhost:8086))*.

2. In the navigation menu on the left, select **Data** (**Load Data**) \> **Telegraf**.

   Load Data

3. Click  **Create Configuration**.

4. In the **Bucket** dropdown, select the bucket where Telegraf will store collected data.

5. Select one or more of the available plugin groups and click **Continue**.

6. Review the list of **Plugins to Configure** for configuration requirements.
   Plugins listed with a ✓require no additional configuration.
   To configure a plugin or access plugin documentation, click the plugin name.

7. Provide a **Telegraf Configuration Name** and an optional **Telegraf Configuration Description**.

8. Adjust configuration settings as needed. To find configuration settings for a specific plugin, see [Telegraf plugins](/telegraf/latest/plugins/).

9. Click **Save and Test**.

10. The **Test Your Configuration** page provides instructions for how to start Telegraf using the generated configuration.*See [Start Telegraf](#start-telegraf) below for detailed information about what each step does.*

11. Once Telegraf is running, click **Listen for Data** to confirm Telegraf is successfully sending data to InfluxDB.
   Once confirmed, a **Connection Found!** message appears.

12. Click **Finish**. Your Telegraf configuration name and the associated bucket name appears in the list of Telegraf configurations.

### Windows

If you plan to monitor a Windows host using the System plugin, you must complete the following steps.

1. In the list of Telegraf configurations, double-click your
   Telegraf configuration, and then click **Download Config**.

2. Open the downloaded Telegraf configuration file and replace the `[[inputs.processes]]` plugin with one of the following Windows plugins, depending on your Windows configuration:

   * [`[[inputs.win_perf_counters]]`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters)
   * [`[[inputs.win_services]]`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_services)

3. Save the file and place it in a directory that **telegraf.exe** can access.

## Start Telegraf

Requests to the [InfluxDB v2 API](/influxdb/v2/reference/api/) must include an API token.
A token identifies specific permissions to the InfluxDB instance.

### Configure your token as an environment variable

1. Find your API token. *For information about viewing tokens, see [View tokens](/influxdb/v2/admin/tokens/view-tokens/).*

2. To configure your API token as the `INFLUX_TOKEN` environment variable, run the command appropriate for your operating system and command-line tool:

#### macOS or Linux ####

```sh
export INFLUX_TOKEN=YourAuthenticationToken
```

#### PowerShell ####

```sh
$env:INFLUX_TOKEN = "YourAuthenticationToken"
```

```sh
set INFLUX_TOKEN=YourAuthenticationToken
# Make sure to include a space character at the end of this command.
```

### Start the Telegraf service

Start the Telegraf service using the `-config` flag to specify the location of the generated Telegraf configuration file.

* For Windows, the location is always a local file path.
* For Linux and macOS, the location can be a local file path or URL.

Telegraf starts using the Telegraf configuration pulled from InfluxDB API.

> [!Note]
> InfluxDB host URLs and ports differ between InfluxDB OSS and InfluxDB Cloud.
> For the exact command, see the Telegraf configuration **Setup Instructions** in the InfluxDB UI.

```sh
telegraf -config http://localhost:8086/api/v2/telegrafs/0xoX00oOx0xoX00o
```

## Manage Telegraf configurations

For more information about managing Telegraf configurations in InfluxDB, see[Telegraf configurations](/influxdb/v2/tools/telegraf-configs/).

#### Related

* [Create a Telegraf configuration](/influxdb/v2/tools/telegraf-configs/create/)
