nsq_to_file: update to use a PCRE-style regex to support including lookaheads and backreferences in a topic-pattern to allow for wildcard archiving with exclusions#1519
Open
danbf wants to merge 2 commits into
Conversation
03673ea to
b694bf4
Compare
…okaheads and backreferences in in topic-pattern to allow for wildcard archiving with exclusions
1a1451b to
30d249c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
addresses issue: #1517
Right now
nsq_to_fileonly supports RE2 style regex's innsq/apps/nsq_to_file/topic_discoverer.go
Line 99 in 51470ca
regexp.MatchString. This prevents the use of wildcard archiving with exclusions which is a use case we have.So a topic pattern like
.*works but one like^(?!not_so_important_events$)[a-z0-9_]+$which would ignore the topicnot_so_important_eventsdoesn't work since it requires lookaheads which RE2 does not permit.like: https://regex101.com/r/4S2pGx/1
Added the https://github.com/philipprochazka/regexp2 library and used it for this regex in
nsq/apps/nsq_to_file/topic_discoverer.go
Line 99 in 51470ca