Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Aggregate & Capture Processor Options #75

Merged
merged 4 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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