Skip to content

Commit

Permalink
[libbeeat] add DropFields processor to js API (#33458)
Browse files Browse the repository at this point in the history
Co-authored-by: Tiago Queiroz <[email protected]>
  • Loading branch information
mib1185 and belimawr authored Dec 21, 2022
1 parent 6c99e92 commit 255028c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ The list below covers the major changes between 7.0.0-rc2 and main only.
- Use `T.TempDir` to create temporary test directory {pull}33082[33082]
- Add an option to disable event normalization when creating a `beat.Client`. {pull}33657[33657]
- Add the file path of the instance lock on the error when it's is already locked {pull}33788[33788]
- Add DropFields processor to js API {pull}33458[33458]

==== Deprecated

Expand Down
3 changes: 3 additions & 0 deletions libbeat/processors/actions/drop_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/processors"
"github.com/elastic/beats/v7/libbeat/processors/checks"
jsprocessor "github.com/elastic/beats/v7/libbeat/processors/script/javascript/module/processor"
conf "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/mapstr"
)
Expand All @@ -46,6 +47,8 @@ func init() {
checks.ConfigChecked(newDropFields,
checks.RequireFields("fields"),
checks.AllowedFields("fields", "when", "ignore_missing")))

jsprocessor.RegisterPlugin("DropFields", newDropFields)
}

func newDropFields(c *conf.C) (processors.Processor, error) {
Expand Down

0 comments on commit 255028c

Please sign in to comment.