-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor #36506
Changes from 5 commits
d7a20b7
3c9f832
9dbd74f
37b40d9
96f32f9
41c0534
beb7e85
1daafec
1c5541e
c1313cf
bc4f64e
27d147a
6a03eb4
d26c658
a7ed8ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ package cmd | |
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/spf13/pflag" | ||
|
||
|
@@ -71,10 +72,25 @@ func defaultProcessors() []mapstr.M { | |
// - add_cloud_metadata: ~ | ||
// - add_docker_metadata: ~ | ||
// - add_kubernetes_metadata: ~ | ||
return []mapstr.M{ | ||
{"add_host_metadata": nil}, | ||
{"add_cloud_metadata": nil}, | ||
{"add_docker_metadata": nil}, | ||
{"add_kubernetes_metadata": nil}, | ||
|
||
// We check for the existance of environmental variable NETINFO. Related to https://github.com/elastic/integrations/issues/6674 | ||
valueNETINFO, status := os.LookupEnv("NETINFO") | ||
|
||
if valueNETINFO == "false" && status == true { | ||
return []mapstr.M{ | ||
{"add_host_metadata": mapstr.M{ | ||
"netinfo.enabled": "false", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why to enable/disable this at this level and not inside the processor's implementation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 to do that inside the processor implementation. I think in the implementation we could even automatically check if this is running inside k8s or inside a container and either disable netinfo completely or filter out link-local addresses. See also elastic/integrations#6674 (comment). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you all team. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding the fix only to add-host-metadata processor (https://github.com/elastic/beats/pull/36506/files#diff-03b979565735e6707425275586e3215f44192f46e1ac3b456516d93c653eba13R38) seems that works only for metricbeat. Somehow seems we override it for filestream? Will keep looking |
||
}}, | ||
{"add_cloud_metadata": nil}, | ||
{"add_docker_metadata": nil}, | ||
{"add_kubernetes_metadata": nil}, | ||
} | ||
} else { | ||
return []mapstr.M{ | ||
{"add_host_metadata": nil}, | ||
{"add_cloud_metadata": nil}, | ||
{"add_docker_metadata": nil}, | ||
{"add_kubernetes_metadata": nil}, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets have some more details here in the code docs. Jumping to the very long Github issue is not helpful. We can still leave the reference in, but lets add more details here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments in beb7e85