Skip to content

Add configuration option to store NetFlow protocol and tcp_flags fields as integers #17903

@alanliangdev

Description

@alanliangdev

Use Case

In NetFlow (v5/v9/IPFIX), the protocol and tcp_flags fields are defined as unsigned 8-bit integers. However, Telegraf currently converts these fields into human-readable strings. While this improves readability, it is less efficient for large-scale storage and complicates compatibility with tools and pipelines that rely on the original integer representation.

For example, when migrating flow data processing from goflow2 to Telegraf, logic expecting numeric values fails due to the type mismatch.

Expected behavior

Introduce a configuration toggle (e.g., raw_protocol_fields = true) that disables automatic string conversion, allowing Telegraf to store the raw integer values for protocol and tcp_flags.

Actual behavior

Telegraf currently converts these fields into string representations by default. There is no configuration option to preserve the original numeric format.

Additional info

https://github.com/influxdata/telegraf/blob/master/plugins/inputs/netflow/type_conversion.go#L30
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/netflow/type_conversion.go#L222

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequests for new plugin and for new features to existing plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions