Don't set values when pattern doesn't match in regex processor (#4396)

This commit is contained in:
Alexander Shepelin
2018-07-07 02:13:46 +03:00
committed by Daniel Nelson
parent a0ece79191
commit 35d2f90d6c
2 changed files with 8 additions and 5 deletions

View File

@@ -222,7 +222,7 @@ func TestNoMatches(t *testing.T) {
},
},
{
message: "Should emit empty string when result_key given but regex doesn't match",
message: "Should not emit new tag/field when result_key given but regex doesn't match",
converter: converter{
Key: "request",
Pattern: "not_match",
@@ -230,8 +230,7 @@ func TestNoMatches(t *testing.T) {
ResultKey: "new_field",
},
expectedFields: map[string]interface{}{
"request": "/users/42/",
"new_field": "",
"request": "/users/42/",
},
},
}