Skip to content

Commit

Permalink
filebeat/input/{tcp,udp}: fix the base of the queue length parsers
Browse files Browse the repository at this point in the history
This was incorrectly claimed to be decimal due to misreading the kernel source.
  • Loading branch information
efd6 committed Jan 24, 2024
1 parent 90dd513 commit fc7e8b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Fix handling of Juniper SRX structured data when there is no leading junos element. {issue}36270[36270] {pull}36308[36308]
- Fix Filebeat Cisco module with missing escape character {issue}36325[36325] {pull}36326[36326]
- Added a fix for Crowdstrike pipeline handling process arrays {pull}36496[36496]
- Fix TCP/UDP metric queue length parsing base. {pull}37714[37714]

*Heartbeat*

Expand Down
4 changes: 2 additions & 2 deletions filebeat/input/tcp/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ func procNetTCP(path string, addr []string, hasUnspecified bool, addrIsUnspecifi
}
found = true

// queue lengths are decimal, e.g.:
// queue lengths are hex, e.g.:
// - https://elixir.bootlin.com/linux/v6.2.11/source/net/ipv4/tcp_ipv4.c#L2643
// - https://elixir.bootlin.com/linux/v6.2.11/source/net/ipv6/tcp_ipv6.c#L1987
v, err := strconv.ParseInt(string(r), 10, 64)
v, err := strconv.ParseInt(string(r), 16, 64)
if err != nil {
return 0, fmt.Errorf("failed to parse rx_queue: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions filebeat/input/udp/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ func procNetUDP(path string, addr []string, hasUnspecified bool, addrIsUnspecifi
}
found = true

// queue lengths and drops are decimal, e.g.:
// queue lengths and drops are hex, e.g.:
// - https://elixir.bootlin.com/linux/v6.2.11/source/net/ipv4/udp.c#L3110
// - https://elixir.bootlin.com/linux/v6.2.11/source/net/ipv6/datagram.c#L1048
v, err := strconv.ParseInt(string(r), 10, 64)
v, err := strconv.ParseInt(string(r), 16, 64)
if err != nil {
return 0, 0, fmt.Errorf("failed to parse rx_queue: %w", err)
}
Expand Down

0 comments on commit fc7e8b0

Please sign in to comment.