Skip to content

Commit

Permalink
fix: Aggregate & Capture Processor Options (#75)
Browse files Browse the repository at this point in the history
* fix: named_group opt

* fix: key opt

* test: cap test

* docs: test name
  • Loading branch information
jshlbrd committed Jan 23, 2023
1 parent 32b76a3 commit 46233a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion process/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type procAggregateOptions struct {
//
// This is only used when handling objects and defaults to an
// empty string.
Key string `json:"aggregate_key"`
Key string `json:"key"`
// Separator is the string that joins aggregated data.
//
// This is only used when handling data and defaults to an empty
Expand Down
4 changes: 2 additions & 2 deletions process/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type procCaptureOptions struct {
//
// - find_all: applies the FindAll(String)?Submatch function (see count)
//
// - namedprocGroup: applies the Find(String)?Submatch function and stores
// - named_group: applies the Find(String)?Submatch function and stores
// values as objects using subexpressions
Type string `json:"type"`
// Count manages the number of repeated capture groups.
Expand Down Expand Up @@ -106,7 +106,7 @@ func (p procCapture) Apply(ctx context.Context, capsule config.Capsule) (config.
capsule.SetData(match[1])

return capsule, nil
case "namedprocGroup":
case "named_group":
newCapsule := config.NewCapsule()

names := re.SubexpNames()
Expand Down
4 changes: 2 additions & 2 deletions process/capture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ var captureTests = []struct {
nil,
},
{
"namedprocGroup",
"named_group",
procCapture{
Options: procCaptureOptions{
Type: "namedprocGroup",
Type: "named_group",
Expression: "(?P<foo>[a-zA-Z]+) (?P<qux>[a-zA-Z]+)",
},
},
Expand Down

0 comments on commit 46233a4

Please sign in to comment.