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 nested captured groups indexing in replace stage #3381

Merged
merged 5 commits into from
Feb 26, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix typo in test
  • Loading branch information
adityacs committed Feb 25, 2021
commit 41c9ee95dc85d49b27ad7c1553e2c2412c3d05cc
4 changes: 2 additions & 2 deletions pkg/logentry/stages/replace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pipeline_stages:
replace: '{{ if eq .Value "200" }}{{ Replace .Value "200" "HttpStatusOk" -1 }}{{ else }}{{ .Value | ToUpper }}{{ end }}'
`

var testReplaceYamlWithNestedCaputedGroups = `
var testReplaceYamlWithNestedCapturedGroups = `
---
pipeline_stages:
-
Expand Down Expand Up @@ -111,7 +111,7 @@ func TestPipeline_Replace(t *testing.T) {
`11.11.11.11 - FRANK [25/JAN/2000:14:00:01 -0500] "GET /1986.JS HTTP/1.1" HttpStatusOk 932 "-" "MOZILLA/5.0 (WINDOWS; U; WINDOWS NT 5.1; DE; RV:1.9.1.7) GECKO/20091221 FIREFOX/3.5.7 GTB6"`,
},
"successfully run a pipeline with 1 regex stage with nested captured groups and with template and without source": {
testReplaceYamlWithNestedCaputedGroups,
testReplaceYamlWithNestedCapturedGroups,
testReplaceLogLine,
map[string]interface{}{
"IP_USER": "11.11.11.11 - FRANK",
Expand Down