Add field selection and table formatting for parse/search commands#101
Merged
Add field selection and table formatting for parse/search commands#101
Conversation
- Add --fields (-f) option to parse and search commands for selecting output fields - Add proper table formatting with borders using tabled crate for --format table - Change default format for parse/search to PSV (pipe-separated values) for streaming compatibility - Add markdown format support with header rows - Separate default fields: parse excludes collector, search includes it - Collector field only appears when explicitly requested or in search defaults Closes #99
digizeph
added a commit
that referenced
this pull request
Jan 29, 2026
- Add OrderByField enum with sortable fields: timestamp, prefix, peer_ip, peer_asn, as_path, next_hop - Add OrderDirection enum with asc/desc options - Add sort_elems() function for sorting buffered BGP elements - Update parse command to buffer and sort output when ordering is requested - Update search command to buffer and sort output when ordering is requested - Update CHANGELOG.md with unreleased changes for #98 and #101 When --order-by is specified, output is buffered before display to enable sorting. This allows users to view results in chronological or reverse chronological order. Closes #98
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.
Summary
This PR improves the output formatting for
monocle parseandmonocle searchcommands by adding:--fields/-f): Choose which columns to display--format tableChanges
--fieldsoption accepts comma-separated field names (e.g.,-f prefix,as_path,collector)tabledcrate with rounded borders instead of tab-separated valuescollectorfield (not applicable)collectorfieldAvailable Fields
type,timestamp,peer_ip,peer_asn,prefix,as_path,origin,next_hop,local_pref,med,communities,atomic,aggr_asn,aggr_ip,collectorExamples
Closes #99