Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chg: [unifiedlog_iterator] support jsonl output and more params #32

Merged
merged 6 commits into from
Nov 29, 2024

Conversation

cvandeplas
Copy link
Contributor

This change brings support for jsonl output.
The output can be saved to a file, or to the standard output.
If the user does not specify the output format as -f parameter, it defaults to autodetect it based on the filename.
The user can also specify to --append append or not (default). I found the previous default of appending quite confusing.

Please do not hesitate to correct my code, as I'm not very familiar with Rust.
For sanity check the csv output before and after my change is the same.

The parameters are therefore now:

Usage: unifiedlog_iterator [OPTIONS]

Options:
  -l, --live <LIVE>      Run on live system [default: false]
  -i, --input <INPUT>    Path to logarchive formatted directory [default: ]
  -o, --output <OUTPUT>  Path to output file. Any directories must already exist [default: ]
  -f, --format <FORMAT>  Output format. Options: csv, jsonl. Default is autodetect [default: auto]
  -a, --append           Append to output file If false, will overwrite output file
  -h, --help             Print help
  -V, --version          Print version

@puffyCid
Copy link
Collaborator

thanks!
I will try to review and merge this weekend

@puffyCid
Copy link
Collaborator

everything looks fine @cvandeplas. Only 2 small requests:

  1. Please run cargo fmt on the unifiedlog_iterator example
  2. Please run cargo clippy on the unifiedlog_iterator example and fix the very minor clippy issues

Thanks!

@cvandeplas
Copy link
Contributor Author

I believe this should address the issues.
Note that there was one issue with the parser.rs that occurred when I merged with upstream. This commit also fixes that one.

@puffyCid puffyCid merged commit 21a286f into mandiant:main Nov 29, 2024
5 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