Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat] udp input - unneccessary multiplication by KiB #41131

Closed
andrewkroh opened this issue Oct 4, 2024 · 1 comment · Fixed by #41211
Closed

[Filebeat] udp input - unneccessary multiplication by KiB #41131

andrewkroh opened this issue Oct 4, 2024 · 1 comment · Fixed by #41211
Labels
Filebeat Filebeat Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution

Comments

@andrewkroh
Copy link
Member

socketSize := int(u.config.ReadBuffer) * humanize.KiByte
if socketSize != 0 {
if err := listener.SetReadBuffer(int(u.config.ReadBuffer)); err != nil {

There is no need to multiple the config.ReadBuffer by the size of KiB. The value is already converted into the user's specified unit type when the config is unmarshaled. And secondly, the resulting value is only used in the context of checking if it is non-zero.

So just remove the entire declaration of the socketSize variable in this code.

@andrewkroh andrewkroh added the Filebeat Filebeat label Oct 4, 2024
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 4, 2024
@andrewkroh andrewkroh added Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution and removed Filebeat Filebeat needs_team Indicates that the issue/PR needs a Team:* label labels Oct 8, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Filebeat Filebeat Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants