[DaC] [Bug] Rule Formatter Line Wrapping Breaks Query String Filters#6046
Merged
Conversation
Contributor
Bug - GuidelinesThese guidelines serve as a reminder set of considerations when addressing a bug in the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
5 tasks
terrancedejesus
approved these changes
May 4, 2026
Contributor
terrancedejesus
left a comment
There was a problem hiding this comment.
Deep dived with @eric-forte-elastic on this. Approving!
Mikaayenson
approved these changes
May 5, 2026
Contributor
Mikaayenson
left a comment
There was a problem hiding this comment.
small nit suggestion. otherwise lgtm. might need to lint
Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
Co-authored-by: Mika Ayenson, PhD <Mikaayenson@users.noreply.github.com>
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.
Pull Request
Issue link(s):
Resolves #6045
Resolves #6071
Closes #6074
Summary - What I changed
This PR updates the logic for handling long KQL Literals that can be incorrectly newline split when writing from ndjson -> TOML through our rule formatter that wraps the text output at 120 characters.
Left is new desired output, and the right is the old output.

Instead of turning this into a multi-line. We now are preserving the format of any value underneath
queryfrom the Kibana Filter dataclass.How To Test
Import and export the pre-built rule
rules/windows/defense_evasion_posh_assembly_load.tomland see if the following query path is wrapped or not.To help with this you can use the following ndjson
test_string_conversion.ndjson.txt
Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist