From 19d063dee8b497871637cd2e97990c4583e39b4a Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 24 Feb 2020 14:36:04 +0100 Subject: [PATCH 1/2] Remove stateful processors from the script processor 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. --- CHANGELOG.next.asciidoc | 2 ++ libbeat/processors/add_docker_metadata/add_docker_metadata.go | 2 -- libbeat/processors/add_kubernetes_metadata/kubernetes.go | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 76f8d0eb4488..5edb2f9e3f67 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -13,6 +13,8 @@ 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 ca +n still be used as normal processors in the configuration. {issue}16349[16349] {pull}[] *Auditbeat* diff --git a/libbeat/processors/add_docker_metadata/add_docker_metadata.go b/libbeat/processors/add_docker_metadata/add_docker_metadata.go index 8020955dd591..994ffae9afc9 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 743c192902f7..f83bb3ab9b08 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) From b6b9d5f93caafc9c011ed312c9f4907032a817a9 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 24 Feb 2020 14:45:39 +0100 Subject: [PATCH 2/2] Fix changelog --- CHANGELOG.next.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 5edb2f9e3f67..289474d1a524 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -13,8 +13,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 ca -n still be used as normal processors in the configuration. {issue}16349[16349] {pull}[] +- 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*