Repository navigation
feat: add analyse evtx subcommand for per-Event-ID summary stats - #231
Merged
alexkornitzer merged 1 commit intoMay 2, 2026
Merged
Conversation
Provides generic summary statistics for evtx files: total record count, per-Channel record counts, and per-Event-ID frequency tables grouped by Channel. Output supported in both text and JSON. Refs WithSecureOpenSource#160.
Collaborator
|
LGTM |
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.
Closes #160.
Picks up Alex's nudge in #160 (comment) and adds
analyse evtxas a generic summary statistics command for evtx files. Scope is exactly what was discussed in that comment, the per-Event-ID frequency table from the issue. The Sigma-hit--statisticsvariant is left for a separate PR since Alex flagged perf concerns there.Output matches the format in the original issue:
Per-Channel grouping is included because the same Event ID can mean different things in different channels, so a flat table loses information. JSON output is also supported via
-j.Implementation lives in
src/analyse/evtx.rsand follows the same shape assrc/analyse/gaps.rs: data types (FileEvtxStats,ChannelEventIdStats,EventIdCount), anEvtxAnalyserwalker that reads each evtx once, and aprint_text_reportfor human output.EventIDextraction handles the cases where it shows up as a JSON number, a string-encoded number, or a tagged object with a#textchild.CLI flags mirror
analyse gapswhere they apply:--json,-o,-q,--skip-errors. Time-range filtering (--from/--to) is left out for now since the issue did not ask for it. Easy to add later if it is wanted.Tests cover per-Channel grouping, per-Event-ID counting, sorting within a channel, the empty-input case, and the EventID extraction helper across number, string, and
{#text: ...}shapes.Verified end to end against
tests/evtx/security_sample.evtx. Build clean, clippy clean, 27 lib tests pass.