Skip to content

CLI: Filter output with presets from the GUI - #2648

Merged
AmmarAbouZor merged 1 commit into
esrlabs:masterfrom
AmmarAbouZor:cli-presets
Sep 23, 2026
Merged

AmmarAbouZor merged 1 commit into
esrlabs:masterfrom
AmmarAbouZor:cli-presets

Conversation

@AmmarAbouZor

Copy link
Copy Markdown
Contributor

This PR closes #2643

It includes:

  • Add global -p, --preset option loading a preset document exported from the GUI and writing the records matching its enabled filters only. Filtering happens while parsing, so it works for files, TCP and UDP alike.
  • Read the documents with a small serde module in the CLI, sharing the fixtures with the GUI importer tests to keep both parsers in sync.
  • Match on the canonical message rendering inside the text formatter, where it exists already, and move output file, flushing and message counters into a MessageWriter, which also reports the dropped records in the session summary.
  • Reject --preset with binary output during argument validation; filtering binary records needs DLT-level filters instead.

Core Crates:

  • Combine the filters in processor with the rule the search already uses, collapsing the two existing copies of it into filter::as_combined_regex next to the new LineSearcher::from_filters.

Also CLI version is pumped to 0.3.0 + Updates for Changelog and repo docs

* Add global `-p, --preset` option loading a preset document exported
  from the GUI and writing the records matching its enabled filters
  only. Filtering happens while parsing, so it works for files, TCP and
  UDP alike.
* Read the documents with a small serde module in the CLI, sharing the
  fixtures with the GUI importer tests to keep both parsers in sync.
* Match on the canonical message rendering inside the text formatter,
  where it exists already, and move output file, flushing and message
  counters into a `MessageWriter`, which also reports the dropped
  records in the session summary.
* Reject `--preset` with binary output during argument validation;
  filtering binary records needs DLT-level filters instead.

Core Crates:
* Combine the filters in `processor` with the rule the search already
  uses, collapsing the two existing copies of it into
  `filter::as_combined_regex` next to the new `LineSearcher::from_filters`.
@AmmarAbouZor
AmmarAbouZor merged commit da4f01b into esrlabs:master Sep 23, 2026
1 check passed
@AmmarAbouZor
AmmarAbouZor deleted the cli-presets branch September 23, 2026 11:17
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.

[chipmunk-cli] Add option to apply JSON filter presets (--filter-preset) to filter output

1 participant