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

Split out negation behaviour into a new TextQueryBackend subclass #86

Open
kelnage opened this issue Sep 5, 2023 · 0 comments
Open
Assignees
Labels
enhancement New feature or request refactoring Making the codebase better by organising it appropriately

Comments

@kelnage
Copy link
Collaborator

kelnage commented Sep 5, 2023

Due to the way negation works differently in Loki when compared with many other query languages (i.e., it lacks a NOT operator, only supporting individually negated conditions), a large number of changes to the default TextQueryBackend class had to be made within our backend to achieve feature parity. Currently, these changes are intertwined into our implementation of the LogQLBackend (e.g., in update_parsed_conditions, set_expression_templates, and convert_field_expression_to_line_filter).

A concern from this is that future updates to pySigma may easily lead to breaking our negation approach (hence the large number of unit tests for negated queries). If we were able to refactor this functionality into a separate TextQueryBackend subclass, it might reduce the likelihood/impact of such an occurrence, should help reduce the code complexity of the LogQLBackend, and might allow it to be moved more easily into the pySigma project for future maintenance when the library is updated.

@kelnage kelnage self-assigned this Sep 5, 2023
@kelnage kelnage added enhancement New feature or request refactoring Making the codebase better by organising it appropriately labels Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring Making the codebase better by organising it appropriately
Projects
None yet
Development

No branches or pull requests

1 participant