From d7a20b7f31e330ede122a61495b28e76221563af Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Thu, 29 Jun 2023 13:20:42 +0300 Subject: [PATCH 01/14] adding check for host processor in case of K8s --- x-pack/metricbeat/cmd/root.go | 41 +++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index 455eb335e19..6e304c06156 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -7,6 +7,7 @@ package cmd import ( "flag" "fmt" + "os" "github.com/spf13/pflag" @@ -49,7 +50,8 @@ func init() { management.ConfigTransform.SetTransform(metricbeatCfg) var runFlags = pflag.NewFlagSet(Name, pflag.ExitOnError) runFlags.AddGoFlag(flag.CommandLine.Lookup("system.hostfs")) - globalProcs, err := processors.NewPluginConfigFromList(defaultProcessors()) + checkKubernetesInstallation := verifyKubernetesInstallation() + globalProcs, err := processors.NewPluginConfigFromList(defaultProcessors(checkKubernetesInstallation)) if err != nil { // these are hard-coded, shouldn't fail panic(fmt.Errorf("error creating global processors: %w", err)) } @@ -65,16 +67,41 @@ func init() { RootCmd.TestCmd.AddCommand(test.GenTestModulesCmd(Name, "", beater.DefaultTestModulesCreator())) } -func defaultProcessors() []mapstr.M { +func defaultProcessors(check bool) []mapstr.M { // processors: // - add_host_metadata: ~ // - 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}, + valueNETINFO, status := os.LookupEnv("NETINFO") + + if check == true || (valueNETINFO == "true" && status == true) { + return []mapstr.M{ + {"add_host_metadata": mapstr.M{ + "netinfo.enabled": "false", + }}, + {"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}, + } } } + +func verifyKubernetesInstallation() bool { + isKubernetes := false + if _, err := os.Stat("/var/run/secrets/kubernetes.io"); err == nil { + fmt.Printf("PASOLE") + isKubernetes = true + } else if _, present := os.LookupEnv("KUBERNETES_SERVICE_HOST"); present == true { + isKubernetes = true + } + + return isKubernetes +} From 3c9f832dc339cb8299d8f89da50034943a658c98 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Thu, 29 Jun 2023 14:43:53 +0300 Subject: [PATCH 02/14] adding check for host processor in case of K8s --- x-pack/metricbeat/cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index 6e304c06156..efd341ded1d 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -75,7 +75,7 @@ func defaultProcessors(check bool) []mapstr.M { // - add_kubernetes_metadata: ~ valueNETINFO, status := os.LookupEnv("NETINFO") - if check == true || (valueNETINFO == "true" && status == true) { + if check == true || (valueNETINFO == "false" && status == true) { return []mapstr.M{ {"add_host_metadata": mapstr.M{ "netinfo.enabled": "false", From 9dbd74f5bf34afd66fe50488d7d4486cebc565ab Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Tue, 5 Sep 2023 15:55:32 +0300 Subject: [PATCH 03/14] Updating root file to only have env variable check --- x-pack/metricbeat/cmd/root.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index efd341ded1d..9904e21ce28 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -50,8 +50,7 @@ func init() { management.ConfigTransform.SetTransform(metricbeatCfg) var runFlags = pflag.NewFlagSet(Name, pflag.ExitOnError) runFlags.AddGoFlag(flag.CommandLine.Lookup("system.hostfs")) - checkKubernetesInstallation := verifyKubernetesInstallation() - globalProcs, err := processors.NewPluginConfigFromList(defaultProcessors(checkKubernetesInstallation)) + globalProcs, err := processors.NewPluginConfigFromList(defaultProcessors()) if err != nil { // these are hard-coded, shouldn't fail panic(fmt.Errorf("error creating global processors: %w", err)) } @@ -67,7 +66,7 @@ func init() { RootCmd.TestCmd.AddCommand(test.GenTestModulesCmd(Name, "", beater.DefaultTestModulesCreator())) } -func defaultProcessors(check bool) []mapstr.M { +func defaultProcessors() []mapstr.M { // processors: // - add_host_metadata: ~ // - add_cloud_metadata: ~ @@ -75,7 +74,7 @@ func defaultProcessors(check bool) []mapstr.M { // - add_kubernetes_metadata: ~ valueNETINFO, status := os.LookupEnv("NETINFO") - if check == true || (valueNETINFO == "false" && status == true) { + if valueNETINFO == "false" && status == true { return []mapstr.M{ {"add_host_metadata": mapstr.M{ "netinfo.enabled": "false", @@ -93,15 +92,3 @@ func defaultProcessors(check bool) []mapstr.M { } } } - -func verifyKubernetesInstallation() bool { - isKubernetes := false - if _, err := os.Stat("/var/run/secrets/kubernetes.io"); err == nil { - fmt.Printf("PASOLE") - isKubernetes = true - } else if _, present := os.LookupEnv("KUBERNETES_SERVICE_HOST"); present == true { - isKubernetes = true - } - - return isKubernetes -} From 37b40d9f69fd0a98fe1ca6fb84b75636023a9329 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Tue, 5 Sep 2023 16:06:00 +0300 Subject: [PATCH 04/14] Adding comment --- x-pack/metricbeat/cmd/root.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index 9904e21ce28..a8de0b312bf 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -72,6 +72,8 @@ func defaultProcessors() []mapstr.M { // - add_cloud_metadata: ~ // - add_docker_metadata: ~ // - add_kubernetes_metadata: ~ + + // 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 { From 96f32f950c2b6775b8bd42d41b11d1ff3fd2d984 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Tue, 5 Sep 2023 16:43:48 +0300 Subject: [PATCH 05/14] Adding CHANGELOG.next.asciidoc --- CHANGELOG.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 1b43089e64f..bf79e0d2eed 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -358,6 +358,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415 - Add new parameter `include_linked_accounts` to enable/disable metrics collection from multiple linked AWS Accounts {pull}35648[35648] - Migrate Azure Billing, Monitor, and Storage metricsets to the newer SDK. {pull}33585[33585] - Add support for float64 values parsing for statsd metrics of counter type. {pull}35099[35099] +- [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] *Osquerybeat* From 41c05344a3615a5c2564fffa668d8a707b3bab0e Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Tue, 5 Sep 2023 17:07:17 +0300 Subject: [PATCH 06/14] Adding comments for the change introduced --- x-pack/metricbeat/cmd/root.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index a8de0b312bf..b57d658c47f 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -73,7 +73,9 @@ func defaultProcessors() []mapstr.M { // - add_docker_metadata: ~ // - add_kubernetes_metadata: ~ - // We check for the existance of environmental variable NETINFO. Related to https://github.com/elastic/integrations/issues/6674 + // Setting environmental variable NETINFO:false of Elastic Agent will disable the netinfo.enabled option of add_host_metadata processor. + // This will result to events not being enhanced with host.ip and host.mac + //Related to https://github.com/elastic/integrations/issues/6674 valueNETINFO, status := os.LookupEnv("NETINFO") if valueNETINFO == "false" && status == true { From beb7e85e76bc1e8f8c605d8327c95aa48b8fa385 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Tue, 5 Sep 2023 17:09:17 +0300 Subject: [PATCH 07/14] Adding comments for the change introduced --- x-pack/metricbeat/cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index b57d658c47f..71269034429 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -73,7 +73,7 @@ func defaultProcessors() []mapstr.M { // - add_docker_metadata: ~ // - add_kubernetes_metadata: ~ - // Setting environmental variable NETINFO:false of Elastic Agent will disable the netinfo.enabled option of add_host_metadata processor. + // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor. // This will result to events not being enhanced with host.ip and host.mac //Related to https://github.com/elastic/integrations/issues/6674 valueNETINFO, status := os.LookupEnv("NETINFO") From 1c5541e076ebc2654ddb542e9a4ca6713ab565f2 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Tue, 5 Sep 2023 17:12:01 +0300 Subject: [PATCH 08/14] Adding comments for the change introduced --- x-pack/metricbeat/cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index 71269034429..a14803ab887 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -75,7 +75,7 @@ func defaultProcessors() []mapstr.M { // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor. // This will result to events not being enhanced with host.ip and host.mac - //Related to https://github.com/elastic/integrations/issues/6674 + // Related to https://github.com/elastic/integrations/issues/6674 valueNETINFO, status := os.LookupEnv("NETINFO") if valueNETINFO == "false" && status == true { From c1313cfdc2631d2f7540e249168fa22505f34e75 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Wed, 6 Sep 2023 11:28:48 +0300 Subject: [PATCH 09/14] Adding filebeat fix --- CHANGELOG.next.asciidoc | 3 ++- x-pack/filebeat/cmd/root.go | 31 ++++++++++++++++++++++--------- x-pack/metricbeat/cmd/root.go | 4 ++-- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 403016faa0e..9bc4842fc19 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -16,12 +16,14 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] *Filebeat* +- [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] *Heartbeat* *Metricbeat* +- [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] *Osquerybeat* @@ -232,7 +234,6 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Add new parameter `include_linked_accounts` to enable/disable metrics collection from multiple linked AWS Accounts {pull}35648[35648] - Migrate Azure Billing, Monitor, and Storage metricsets to the newer SDK. {pull}33585[33585] - Add support for float64 values parsing for statsd metrics of counter type. {pull}35099[35099] -- [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] - Add kubernetes.deployment.status.* fields for Kubernetes module {pull}35999[35999] - Add Azure resource tags support to Azure Billing module {pull}36428[36428] diff --git a/x-pack/filebeat/cmd/root.go b/x-pack/filebeat/cmd/root.go index 77dadde7b16..57835954db9 100644 --- a/x-pack/filebeat/cmd/root.go +++ b/x-pack/filebeat/cmd/root.go @@ -52,15 +52,28 @@ func defaultProcessors() []mapstr.M { if shipperEnv == "True" { return []mapstr.M{} } - return []mapstr.M{ - { - "add_host_metadata": mapstr.M{ + + // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor. + // This will result to events not being enhanced with host.ip and host.mac + // Related to https://github.com/elastic/integrations/issues/6674 + valueNETINFO, _ := os.LookupEnv("NETINFO") + + if valueNETINFO == "false" { + return []mapstr.M{ + {"add_host_metadata": mapstr.M{ "when.not.contains.tags": "forwarded", - }, - }, - {"add_cloud_metadata": nil}, - {"add_docker_metadata": nil}, - {"add_kubernetes_metadata": nil}, + "netinfo.enabled": "false", + }}, + {"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}, + } } - } diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index a14803ab887..555f8f88a57 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -76,9 +76,9 @@ func defaultProcessors() []mapstr.M { // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor. // This will result to events not being enhanced with host.ip and host.mac // Related to https://github.com/elastic/integrations/issues/6674 - valueNETINFO, status := os.LookupEnv("NETINFO") + valueNETINFO, _ := os.LookupEnv("NETINFO") - if valueNETINFO == "false" && status == true { + if valueNETINFO == "false" { return []mapstr.M{ {"add_host_metadata": mapstr.M{ "netinfo.enabled": "false", From bc4f64e24c37eb7195361f005841ed51c009b6c9 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Wed, 6 Sep 2023 12:44:35 +0300 Subject: [PATCH 10/14] Adding fix only t add-host-metadata processor and removed per beats --- CHANGELOG.next.asciidoc | 3 +- .../processors/add_host_metadata/config.go | 22 ++++++++++--- x-pack/filebeat/cmd/root.go | 31 ++++++------------- x-pack/metricbeat/cmd/root.go | 29 ++++------------- 4 files changed, 33 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 9bc4842fc19..38ae3ab679a 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -11,19 +11,18 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] *Affecting all Beats* - Fix status reporting to Elastic-Agent when output configuration is invalid running under Elastic-Agent {pull}35719[35719] - Upgrade Go to 1.20.7 {pull}36241[36241] +- [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] *Auditbeat* *Filebeat* -- [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] *Heartbeat* *Metricbeat* -- [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] *Osquerybeat* diff --git a/libbeat/processors/add_host_metadata/config.go b/libbeat/processors/add_host_metadata/config.go index 17133e1b55a..b044d71cc62 100644 --- a/libbeat/processors/add_host_metadata/config.go +++ b/libbeat/processors/add_host_metadata/config.go @@ -18,6 +18,7 @@ package add_host_metadata import ( + "os" "time" "github.com/elastic/beats/v7/libbeat/processors/util" @@ -34,10 +35,21 @@ type Config struct { } func defaultConfig() Config { - return Config{ - NetInfoEnabled: true, - CacheTTL: 5 * time.Minute, - ExpireUpdateTimeout: time.Second * 10, - ReplaceFields: true, + valueNETINFO, _ := os.LookupEnv("NETINFO") + + if valueNETINFO == "false" { + return Config{ + NetInfoEnabled: false, + CacheTTL: 5 * time.Minute, + ExpireUpdateTimeout: time.Second * 10, + ReplaceFields: true, + } + } else { + return Config{ + NetInfoEnabled: true, + CacheTTL: 5 * time.Minute, + ExpireUpdateTimeout: time.Second * 10, + ReplaceFields: true, + } } } diff --git a/x-pack/filebeat/cmd/root.go b/x-pack/filebeat/cmd/root.go index 57835954db9..77dadde7b16 100644 --- a/x-pack/filebeat/cmd/root.go +++ b/x-pack/filebeat/cmd/root.go @@ -52,28 +52,15 @@ func defaultProcessors() []mapstr.M { if shipperEnv == "True" { return []mapstr.M{} } - - // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor. - // This will result to events not being enhanced with host.ip and host.mac - // Related to https://github.com/elastic/integrations/issues/6674 - valueNETINFO, _ := os.LookupEnv("NETINFO") - - if valueNETINFO == "false" { - return []mapstr.M{ - {"add_host_metadata": mapstr.M{ + return []mapstr.M{ + { + "add_host_metadata": mapstr.M{ "when.not.contains.tags": "forwarded", - "netinfo.enabled": "false", - }}, - {"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}, - } + }, + }, + {"add_cloud_metadata": nil}, + {"add_docker_metadata": nil}, + {"add_kubernetes_metadata": nil}, } + } diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index 555f8f88a57..376fee0a4e7 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -7,7 +7,6 @@ package cmd import ( "flag" "fmt" - "os" "github.com/spf13/pflag" @@ -72,27 +71,11 @@ func defaultProcessors() []mapstr.M { // - add_cloud_metadata: ~ // - add_docker_metadata: ~ // - add_kubernetes_metadata: ~ - - // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor. - // This will result to events not being enhanced with host.ip and host.mac - // Related to https://github.com/elastic/integrations/issues/6674 - valueNETINFO, _ := os.LookupEnv("NETINFO") - - if valueNETINFO == "false" { - return []mapstr.M{ - {"add_host_metadata": mapstr.M{ - "netinfo.enabled": "false", - }}, - {"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}, - } + return []mapstr.M{ + {"add_host_metadata": nil}, + {"add_cloud_metadata": nil}, + {"add_docker_metadata": nil}, + {"add_kubernetes_metadata": nil}, } + } From 27d147a6b5293af73d462bc1453be55196ff15b5 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Wed, 6 Sep 2023 12:46:48 +0300 Subject: [PATCH 11/14] Adding fix only t add-host-metadata processor and removed per beats --- x-pack/metricbeat/cmd/root.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/metricbeat/cmd/root.go b/x-pack/metricbeat/cmd/root.go index 376fee0a4e7..455eb335e19 100644 --- a/x-pack/metricbeat/cmd/root.go +++ b/x-pack/metricbeat/cmd/root.go @@ -77,5 +77,4 @@ func defaultProcessors() []mapstr.M { {"add_docker_metadata": nil}, {"add_kubernetes_metadata": nil}, } - } From 6a03eb4af9c51452e8ff391a03012403b65befea Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Wed, 6 Sep 2023 16:01:58 +0300 Subject: [PATCH 12/14] Adding comments --- libbeat/processors/add_host_metadata/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libbeat/processors/add_host_metadata/config.go b/libbeat/processors/add_host_metadata/config.go index b044d71cc62..806e71c3573 100644 --- a/libbeat/processors/add_host_metadata/config.go +++ b/libbeat/processors/add_host_metadata/config.go @@ -35,6 +35,9 @@ type Config struct { } func defaultConfig() Config { + // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor + // This will result to events not being enhanced with host.ip and host.mac + // Related to https://github.com/elastic/integrations/issues/6674 valueNETINFO, _ := os.LookupEnv("NETINFO") if valueNETINFO == "false" { From d26c658b90832b7fc2f48100419b9c7919d19b62 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Thu, 7 Sep 2023 11:06:58 +0300 Subject: [PATCH 13/14] Changing variable to ELASTIC_NETINFO --- libbeat/processors/add_host_metadata/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libbeat/processors/add_host_metadata/config.go b/libbeat/processors/add_host_metadata/config.go index 806e71c3573..453c3b2b5f7 100644 --- a/libbeat/processors/add_host_metadata/config.go +++ b/libbeat/processors/add_host_metadata/config.go @@ -35,10 +35,10 @@ type Config struct { } func defaultConfig() Config { - // Setting environmental variable NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor + // Setting environmental variable ELASTIC_NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor // This will result to events not being enhanced with host.ip and host.mac // Related to https://github.com/elastic/integrations/issues/6674 - valueNETINFO, _ := os.LookupEnv("NETINFO") + valueNETINFO, _ := os.LookupEnv("ELASTIC_NETINFO") if valueNETINFO == "false" { return Config{ From a7ed8ee91c83b9b54fe745466e6464957e522055 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Thu, 7 Sep 2023 11:48:41 +0300 Subject: [PATCH 14/14] Updating changelof for variable ELASTIC_NETINFO --- CHANGELOG.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 38ae3ab679a..6cc8c482406 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -12,6 +12,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Fix status reporting to Elastic-Agent when output configuration is invalid running under Elastic-Agent {pull}35719[35719] - Upgrade Go to 1.20.7 {pull}36241[36241] - [Enhanncement for host.ip and host.mac] Disabling netinfo.enabled option of add-host-metadata processor {pull}36506[36506] + Setting environmental variable ELASTIC_NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor *Auditbeat*