Manually configure Telegraf
View the for using Telegraf with InfluxDB v2.2.
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.
See Telegraf plugins for a complete list of available plugins.
To manually add any of the available , follow the steps below.
- Find the plugin you want to enable from the complete list of available Telegraf plugins.
- Click View to the right of the plugin name to open the plugin page on GitHub. For example, view the MQTT plugin GitHub page .
Enable and configure the InfluxDB v2 output plugin
To send data to an InfluxDB v2.2 instance, enable in the in the telegraf.conf
.
To find an example InfluxDB v2 output plugin configuration in the UI:
In the navigation menu on the left, select Data (Load Data) > Telegraf.
Click InfluxDB Output Plugin.
Click Copy to Clipboard to copy the example configuration or Download Config to save a copy.
Paste the example configuration into your
telegraf.conf
and specify the options below.
The InfluxDB output plugin configuration contains the following options:
urls
An array of URLs for your InfluxDB v2.2 instances. See for information about which URLs to use. InfluxDB Cloud requires HTTPS.
token
Your InfluxDB v2.2 authorization token. For information about viewing tokens, see .
Avoid storing tokens in telegraf.conf
We recommend storing your tokens by setting the environment variable and including the environment variable in your configuration file.
See the .
organization
The name of the organization that owns the target bucket.
bucket
The name of the bucket to write data to.
Example influxdb_v2 configuration
The example below illustrates an influxdb_v2
configuration.
Write to InfluxDB v1.x and v2.2
If a Telegraf agent is already writing to an InfluxDB v1.x database, enabling the InfluxDB v2 output plugin will write data to both v1.x and v2.2 instances.
To add a custom or manually configured Telegraf configuration to your collection of Telegraf configurations in InfluxDB, use the influx telegrafs create or commands. For more information, see: