Documentation

SFlow Input Plugin

This service plugin produces metrics from information received by acting as a SFlow V5 collector. Currently, the plugin can collect Flow Samples of Ethernet / IPv4, IPv4 TCP and UDP headers. Counters and other header samples are ignored. Please use the netflow plugin for a more modern and sophisticated implementation.

This plugin produces high cardinality data, which when not controlled for will cause high load on your database. Please make sure to filter the produced metrics or configure your database to avoid cardinality issues!

Introduced in: Telegraf v1.14.0 Tags: network OS support: all

Service Input

This plugin is a service input. Normal plugins gather metrics determined by the interval setting. Service plugins start a service to listen and wait for metrics or events to occur. Service plugins have two key differences from normal plugins:

  1. The global or plugin specific interval setting may not apply
  2. The CLI options of --test, --test-wait, and --once may not produce output for this plugin

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

# SFlow V5 Protocol Listener
[[inputs.sflow]]
  ## Address to listen for sFlow packets.
  ##   example: service_address = "udp://:6343"
  ##            service_address = "udp4://:6343"
  ##            service_address = "udp6://:6343"
  service_address = "udp://:6343"

  ## Set the size of the operating system's receive buffer.
  ##   example: read_buffer_size = "64KiB"
  # read_buffer_size = ""

Metrics

  • sflow
    • tags:
      • agent_address - IP address of the agent obtaining the sflow sample and sent it to this collector
      • source_id_type - type of flow_sample or flow_sample_expanded structures
      • source_id_index - index of flow_sample or flow_sample_expanded structures
      • input_ifindex - input value of flow_sample or flow_sample_expanded structures
      • output_ifindex - output value of flow_sample or flow_sample_expanded structures
      • sample_direction - source_id_index, netif_index_in and netif_index_out
      • header_protocol - header_protocol field of sampled_header structures
      • ether_type - ethernet type of an ETHERNET-ISO88023 header
      • src_ip - source IP address of IPv4 or IPv6 structures
      • src_port - source port of TCP or UDP structures
      • src_port_name - name of the source port
      • src_mac - source MAC address of an ETHERNET-ISO88023 header
      • src_vlan - source VLAN of extended_switch structure
      • src_priority - source priority of extended_switch structure
      • src_mask_len - length of source mask of extended_router structure
      • dst_ip - destination IP address of IPv4 or IPv6 structures
      • dst_port - destination port of TCP or UDP structures
      • dst_port_name - name of the destination port
      • dst_mac - destination MAC address of an ETHERNET-ISO88023 header
      • dst_vlan - destination VLAN of extended_switch structure
      • dst_priority - destination priority extended_switch structure
      • dst_mask_len - length of destinationd mask of extended_router structure
      • next_hop - next hop of extended_router structure
      • ip_version - IP version of IPv4 or IPv6 structures
      • ip_protocol - IP protocol of IPv4 or IPv6 structures
      • ip_dscp - IP DSCP of IPv4 or IPv6 structures
      • ip_ecn - IP ECN of IPv4 or IPv6 structures
      • tcp_urgent_pointer - urgent pointer of TCP structure
    • fields:
      • bytes (int) - product of frame length and packets
      • drops (int) - drops field of flow_sample or flow_sample_expanded structures
      • packets (int) - sampling_rate field of flow_sample or flow_sample_expanded structures
      • frame_length (int) - frame_length field of sampled_header structures
      • header_size (int) - header_size field of sampled_header structures
      • ip_fragment_offset (int) - ip_ver field of IPv4 structures
      • ip_header_length (int) - ip_ver field of IPv4 structures
      • ip_total_length (int) - ip_total_len field of IPv4 structures
      • ip_ttl (int) - ip_ttl field of IPv4 structures or ip_hop_limit field IPv6 structures
      • tcp_header_length (int) - size field of TCP structure. This value is specified in 32-bit words. It must be multiplied by 4 to produce a valuein bytes.
      • tcp_window_size (int) - window_size field of TCP structure
      • udp_length (int) - length field of UDP structures
      • ip_flags (int) - ip_ver field of IPv4 structures
      • tcp_flags (int) - TCP flags of TCP IP header (IPv4 or IPv6)

Troubleshooting

The sflowtool utility can be used to print sFlow packets, and compared against the metrics produced by Telegraf.

sflowtool -p 6343

If opening an issue, in addition to the output of sflowtool it will also be helpful to collect a packet capture. Adjust the interface, host and port as needed:

sudo tcpdump -s 0 -i eth0 -w telegraf-sflow.pcap host 127.0.0.1 and port 6343

Example Output

sflow,agent_address=0.0.0.0,dst_ip=10.0.0.2,dst_mac=ff:ff:ff:ff:ff:ff,dst_port=40042,ether_type=IPv4,header_protocol=ETHERNET-ISO88023,input_ifindex=6,ip_dscp=27,ip_ecn=0,output_ifindex=1073741823,source_id_index=3,source_id_type=0,src_ip=10.0.0.1,src_mac=ff:ff:ff:ff:ff:ff,src_port=443 bytes=1570i,drops=0i,frame_length=157i,header_length=128i,ip_flags=2i,ip_fragment_offset=0i,ip_total_length=139i,ip_ttl=42i,sampling_rate=10i,tcp_header_length=0i,tcp_urgent_pointer=0i,tcp_window_size=14i 1584473704793580447

Was this page helpful?

Thank you for your feedback!


InfluxDB OSS 2.9.0: API tokens are hashed by default

Stronger token security in InfluxDB OSS 2.9.0 — tokens are hashed on disk by default. Existing tokens are hashed on first startup and can’t be recovered afterward. Capture any plaintext tokens you still need before you upgrade.

View InfluxDB OSS 2.9.0 release notes

Hashed tokens authenticate exactly like unhashed tokens — clients and integrations keep working.

Also new in 2.9.0:

  • Configurable backup compression
  • Restore support for backups containing hashed tokens
  • Tighter Edge Data Replication queue validation
  • Flux upgrade
  • Compaction reliability improvements

Key enhancements in Explorer 1.8

Explorer 1.8 is now available with streaming data subscriptions (beta), line protocol preview, and query history & saved queries.

View Explorer 1.8 release notes

Explorer 1.8 includes new features and improvements that make it easier to ingest, explore, and manage data.

Highlights:

  • Streaming data subscriptions (beta): Stream data into Explorer from MQTT, Kafka, and AMQP sources.
  • Line protocol preview: Preview line protocol, schema, and parse errors before data is written.
  • Custom sample data: Generate custom sample datasets with line protocol and schema preview.
  • Query history and saved queries: Browse query history and save/re-run named queries.
  • Retention period management: Set, update, or clear retention periods on databases and tables.

For more details, see Explorer 1.8 release notes

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.7-beta now available

Telegraf Controller v0.0.7-beta is now available with new features, improvements, bug fixes, and an important breaking change.

View the release notes
Download Telegraf Controller v0.0.7-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