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

Double meaning for slashes with new regex syntax #726

Closed
ppcad opened this issue Dec 12, 2024 · 2 comments · Fixed by #734
Closed

Double meaning for slashes with new regex syntax #726

ppcad opened this issue Dec 12, 2024 · 2 comments · Fixed by #734
Assignees
Labels
enhancement New feature or request

Comments

@ppcad
Copy link
Collaborator

ppcad commented Dec 12, 2024

The new regex syntax requires filters to have the form "/REGEX/".
To do this it checks if a term begins and ends with a /.
This leads to problems if the filter term has slashes, but shouldn't be treated as regex (i.e. "/some/path/").

Here are some ideas how this could be implemented:

  1. Add escaping for slashes in the rules ("\/some/path\/") and remove them after the regex check
  2. Don't use " for regex, but only /: So /REGEX/ instead of "/REGEX/"

I prefer idea 2.
Right now omitting the quotation marks leads to a crash of Logprep without an explanation that it was caused by a filter syntax error.

@ppcad ppcad added the enhancement New feature or request label Dec 12, 2024
@ppcad ppcad changed the title Slashes with new regex syntax Double meaning for slashes with new regex syntax Dec 12, 2024
@ppcad ppcad linked a pull request Dec 19, 2024 that will close this issue
@ekneg54
Copy link
Collaborator

ekneg54 commented Jan 4, 2025

@ppcad please have a look at the provided PR from @fabian-moessner if this would solve the problem.

@ppcad
Copy link
Collaborator Author

ppcad commented Jan 6, 2025

@ppcad please have a look at the provided PR from @fabian-moessner if this would solve the problem.

Yes, it solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants