-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[pkg/stanza] Add 'regex_replace' operator #37443
[pkg/stanza] Add 'regex_replace' operator #37443
Conversation
b32fac5
to
411655a
Compare
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.
This is a neat enhancement, thank you. I have reviewed the code and approve it, the codeowners have last word on accepting it.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@djaglowski Could you please take a look? I used mostly the "unquote" operator as a blueprint. So there should not be any surprises. Thanks! |
pkg/stanza/operator/transformer/stripansiescapecodes/transformer.go
Outdated
Show resolved
Hide resolved
411655a
to
0af4984
Compare
This is a follow-up to issue open-telemetry#37443.
This is a follow-up from open-telemetry#37443. It extracts the test logic for operator build errors into re-useable methods.
Description
We use the filelog receiver to ingest Artifactory logs. Some but not all of them contain ANSI color sequences. This makes regex creation pretty uncomfortable because both: log field separators and the ANSI color codes contain
[
characters.I was first thinking about using the
add
operator and removing the regex within theEXPR()
. But I could not find any suitable regex function which works within that expression.I could imagine that I'm not the only one who would like to get rid of colors. Therefore I believe that an easy to use operator enhances readability of the pipeline and is less error-prone than a (potentially) hand-crafted regex.
Testing
Added unit tests and tested locally against Artifactory log files.