diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 5f28b816ca7..0d5d834d4c7 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -11,6 +11,8 @@ 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] + Setting environmental variable ELASTIC_NETINFO:false in Elastic Agent pod will disable the netinfo.enabled option of add_host_metadata processor *Auditbeat* diff --git a/libbeat/processors/add_host_metadata/config.go b/libbeat/processors/add_host_metadata/config.go index 17133e1b55a..453c3b2b5f7 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,24 @@ type Config struct { } func defaultConfig() Config { - return Config{ - NetInfoEnabled: true, - CacheTTL: 5 * time.Minute, - ExpireUpdateTimeout: time.Second * 10, - ReplaceFields: true, + // 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("ELASTIC_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, + } } }