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 <tiago.queiroz@elastic.co>
  • Loading branch information
2 people authored and chrisberkhout committed Jun 1, 2023
1 parent 281e748 commit 1b04084
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 1b04084

Please sign in to comment.