Documentation

Multifile Input Plugin

This plugin reads the combined data from multiple files into a single metric, creating one field or tag per file. This is often useful creating custom metrics from the /sys or /proc filesystems.

To parse metrics from a single file you should use the file input plugin instead.

Introduced in: Telegraf v1.10.0 Tags: system OS support: all

Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See CONFIGURATION.md for more details.

Configuration

# Aggregates the contents of multiple files into a single point
[[inputs.multifile]]
  ## Base directory where telegraf will look for files.
  ## Omit this option to use absolute paths.
  base_dir = "/sys/bus/i2c/devices/1-0076/iio:device0"

  ## If true discard all data when a single file can't be read.
  ## Else, Telegraf omits the field generated from this file.
  # fail_early = true

  ## Files to parse each interval.
  [[inputs.multifile.file]]
    file = "in_pressure_input"
    dest = "pressure"
    conversion = "float"
  [[inputs.multifile.file]]
    file = "in_temp_input"
    dest = "temperature"
    conversion = "float(3)"
  [[inputs.multifile.file]]
    file = "in_humidityrelative_input"
    dest = "humidityrelative"
    conversion = "float(3)"

Metrics

Each file table can contain the following options:

  • file: Path of the file to be parsed, relative to the base_dir.
  • dest: Name of the field/tag key, defaults to $(basename file).
  • conversion: Data format used to parse the file contents:
    • float(X): Converts the input value into a float and divides by the Xth power of 10. Effectively just moves the decimal left X places. For example a value of 123 with float(2) will result in 1.23.
    • float: Converts the value into a float with no adjustment. Same as float(0).
    • int: Converts the value into an integer.
    • string, "": No conversion.
    • bool: Converts the value into a boolean.
    • tag: File content is used as a tag.

Example Output

This example shows a BME280 connected to a Raspberry Pi, using the sample config.

multifile pressure=101.343285156,temperature=20.4,humidityrelative=48.9 1547202076000000000

To reproduce this, connect a BMP280 to the board’s GPIO pins and register the BME280 device driver

cd /sys/bus/i2c/devices/i2c-1
echo bme280 0x76 > new_device

The kernel driver provides the following files in /sys/bus/i2c/devices/1-0076/iio:device0:

  • in_humidityrelative_input: 48900
  • in_pressure_input: 101.343285156
  • in_temp_input: 20400

Was this page helpful?

Thank you for your feedback!


InfluxDB 3.9: Performance upgrade preview

InfluxDB 3 Enterprise 3.9 includes a beta of major performance upgrades with faster single-series queries, wide-and-sparse table support, and more.

InfluxDB 3 Enterprise 3.9 includes a beta of major performance and feature updates.

Key improvements:

  • Faster single-series queries
  • Consistent resource usage
  • Wide-and-sparse table support
  • Automatic distinct value caches for reduced latency with metadata queries

Preview features are subject to breaking changes.

For more information, see:

Telegraf Enterprise now in public beta

Get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

See the Blog Post

The upcoming Telegraf Enterprise offering is for organizations running Telegraf at scale and is comprised of two key components:

  • Telegraf Controller: A control plane (UI + API) that centralizes Telegraf configuration management and agent health visibility.
  • Telegraf Enterprise Support: Official support for Telegraf Controller and Telegraf plugins.

Join the Telegraf Enterprise beta to get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

For more information:

Telegraf Controller v0.0.6-beta now available

Telegraf Controller v0.0.6-beta is now available with new features, improvements, and bug fixes.

View the release notes
Download Telegraf Controller v0.0.6-beta

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On May 27, 2026, 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