-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Add text selector #426
Conversation
@@ -25,3 +31,32 @@ export function replaceCorrelatedValues({ | |||
value: varName, | |||
}) | |||
} | |||
|
|||
function replaceAllTextMatches( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move function here from shared.ts
because it's the only place where it's used.
export const ExtractorSelectorSchema = z.discriminatedUnion('type', [ | ||
BeginEndSelectorSchema, | ||
RegexSelectorSchema, | ||
JsonSelectorSchema, | ||
HeaderNameSelectorSchema, | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split Selector
schema into Extractor
and Replacer
, because Text
selector doesn't apply to extractions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
Add text selector to exact string match replacements. Previously you'd have to use a workaround with regex selector: regex: (value_to_be_placed).
This selector applies to parameterization rule and correlation rule custom replacer, but not correlation extractor, because it doesn't make sense to correlate on static value.
How to Test
Checklist
npm run lint
) and all checks pass.npm test
) and all tests pass.Screenshots (if appropriate):
Related PR(s)/Issue(s)
Resolves #315