inputs.netflow
: Source port and destination port for TCP layer are not being included in metrics when using sFlow v5 decoder
#16139
Labels
bug
unexpected problem or unintended behavior
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf v1.32.0 running on Docker, Debian 12 as base OS
Docker
Steps to reproduce
Same steps as described in issue #15918 (comment)
Expected behavior
Source port and destination port must be present in Telegraf metrics for TCP packets.
Actual behavior
Fields are being decoded by
goflow2
dissector but are not being properly included in TelegrafMetric
struct.Additional info
The issue is related to an already solved issue (see PR #16009).
src_port
anddst_port
for the TCP layer have a custom typelayers.TCPPort
which cannot be included into Telegraf metrics. These variables should be converted touint16
to be properly included into metrics:Affected code lines:
telegraf/plugins/inputs/netflow/sflow_v5.go
Lines 414 to 415 in 115df09
Casting is already done for UDP layer ports and it's working as expected:
telegraf/plugins/inputs/netflow/sflow_v5.go
Lines 441 to 442 in 115df09
The text was updated successfully, but these errors were encountered: