Skip to content

fix: leave Windows event codes in queries unchanged - #55

Merged
f-bader merged 1 commit into
f-bader:mainfrom
lnfernux:fix/windows-event-codes
Nov 19, 2026
Merged

f-bader merged 1 commit into
f-bader:mainfrom
lnfernux:fix/windows-event-codes

Conversation

@lnfernux

Copy link
Copy Markdown
Contributor

Problem

Since 2.5.0, a query that holds two Windows event codes (insertion strings such as %%2089 or %%4418) loses everything between them during conversion, because the default and empty-value replacements read any text between two %% as a variable name. One example is Solorigate Named Pipe in Azure-Sentinel, where EventData has '%%4418' and the following comment line // %%4418 ... collapse into a query that no longer parses.

Changes

  • Variable names must start with a letter or _ in the default, warning and empty-value patterns. The rest of each pattern is unchanged.
  • README naming note and 2.5.1 changelog entry, module version 2.5.1.
  • Test with paired event codes, adjacent codes, a code followed by a colon and one default variable.

Verification

Check Result
New test against 2.5.0 code Fails, query loses 131 characters
Pester 5.9.1 and 6.0.0 129 of 129 pass (127 on main)

What reviewers should know

A variable whose name starts with a digit is no longer replaced. No example, test or README name does. Replacement from a parameter file is unchanged, since it matches each key literally.

Variable names in the default and empty-value replacements must start with a letter or underscore, so event codes such as `%%2089` and `%%4418` are no longer read as variables and removed with the text between them.

Pester passes 129 of 129 on 5.9.1 and 6.0.0.
@f-bader
f-bader merged commit 9b9cd16 into f-bader:main Nov 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants