Skip to content

Commit

Permalink
Remove stateful processors from the script processor (elastic#16514)
Browse files Browse the repository at this point in the history
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 8d31a51)
  • Loading branch information
jsoriano committed Feb 25, 2020
1 parent b983d78 commit e97780c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
2 changes: 0 additions & 2 deletions libbeat/processors/add_docker_metadata/add_docker_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -52,7 +51,6 @@ var processCgroupPaths = cgroup.ProcessCgroupPaths

func init() {
processors.RegisterPlugin(processorName, New)
jsprocessor.RegisterPlugin("AddDockerMetadata", New)
}

type addDockerMetadata struct {
Expand Down
2 changes: 0 additions & 2 deletions libbeat/processors/add_kubernetes_metadata/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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)
Expand Down

0 comments on commit e97780c

Please sign in to comment.