Skip to content

Split out negation behaviour into a new TextQueryBackend subclass #86

@kelnage

Description

@kelnage

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestrefactoringMaking the codebase better by organising it appropriately

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions