From e97780c3ff0751dce16f6dc0adde4db0f16a11b9 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Tue, 25 Feb 2020 10:34:57 +0100 Subject: [PATCH] Remove stateful processors from the script processor (#16514) There are some processors that keep resources that would need to be explicitly released when the processor is not needed anymore. At this moment there is no way to do it, processors have a stateless interface, so avoid using these processors in scripts. If these processors are needed, it is usually better to place them in global configuration. Processors removed are the ones used to add docker and kubernetes metadata. (cherry picked from commit 8d31a512d8dcdc91f3c0247ec5c6fa04e11d2077) --- CHANGELOG.next.asciidoc | 1 + libbeat/processors/add_docker_metadata/add_docker_metadata.go | 2 -- libbeat/processors/add_kubernetes_metadata/kubernetes.go | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 26b8a19f308..cd5399aac77 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -23,6 +23,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - The document id fields has been renamed from @metadata.id to @metadata._id {pull}15859[15859] - Variable substitution from environment variables is not longer supported. {pull}15937{15937} - Change aws_elb autodiscover provider field name from elb_listener.* to aws.elb.*. {issue}16219[16219] {pull}16402{16402} +- Remove `AddDockerMetadata` and `AddKubernetesMetadata` processors from the `script` processor. They can still be used as normal processors in the configuration. {issue}16349[16349] {pull}16514[16514] *Auditbeat* diff --git a/libbeat/processors/add_docker_metadata/add_docker_metadata.go b/libbeat/processors/add_docker_metadata/add_docker_metadata.go index 8020955dd59..994ffae9afc 100644 --- a/libbeat/processors/add_docker_metadata/add_docker_metadata.go +++ b/libbeat/processors/add_docker_metadata/add_docker_metadata.go @@ -37,7 +37,6 @@ import ( "github.com/elastic/beats/libbeat/logp" "github.com/elastic/beats/libbeat/processors" "github.com/elastic/beats/libbeat/processors/actions" - jsprocessor "github.com/elastic/beats/libbeat/processors/script/javascript/module/processor" ) const ( @@ -52,7 +51,6 @@ var processCgroupPaths = cgroup.ProcessCgroupPaths func init() { processors.RegisterPlugin(processorName, New) - jsprocessor.RegisterPlugin("AddDockerMetadata", New) } type addDockerMetadata struct { diff --git a/libbeat/processors/add_kubernetes_metadata/kubernetes.go b/libbeat/processors/add_kubernetes_metadata/kubernetes.go index 743c192902f..f83bb3ab9b0 100644 --- a/libbeat/processors/add_kubernetes_metadata/kubernetes.go +++ b/libbeat/processors/add_kubernetes_metadata/kubernetes.go @@ -33,7 +33,6 @@ import ( "github.com/elastic/beats/libbeat/common/kubernetes/metadata" "github.com/elastic/beats/libbeat/logp" "github.com/elastic/beats/libbeat/processors" - jsprocessor "github.com/elastic/beats/libbeat/processors/script/javascript/module/processor" ) const ( @@ -54,7 +53,6 @@ type kubernetesAnnotator struct { func init() { processors.RegisterPlugin("add_kubernetes_metadata", New) - jsprocessor.RegisterPlugin("AddKubernetesMetadata", New) // Register default indexers Indexing.AddIndexer(PodNameIndexerName, NewPodNameIndexer)