Scout is a command-line application written in Rust for analyzing, viewing, and filtering log files. It supports JSON formatted log files and provides features to analyze log data, view log contents, and filter log entries based on a query.
- Analyze: Compute statistics, identify errors, and extract key metrics from log files.
- View: Display the contents of a log file.
- Filter: Filter log entries based on a query string.
-
Clone the repository:
git clone https://github.com/oussamasf/scout cd scout
-
Build the project::
cargo build --release
-
Run the application:::
cargo run -- <COMMAND> [OPTIONS]
Analyze a JSON log file and generate a report.
scout analyze --file <FILE_PATH> [--type <TYPE>] [--output <OUTPUT_FILE>]
- --file or -f: Specifies the log file to analyze (required).
- --type or -t: Specifies the type of log file (default: json).
- --output or -o: Specifies the output file for the report (default: report.txt).
View the contents of a log file.
scout view --file <FILE_PATH>
- --file or -f: Specifies the log file to view (required).
View the contents of a log file.
scout view --file <FILE_PATH>
- --file or -f: Specifies the log file to filter (required).
- --query or -q: Defines the query for filtering entries (required).
scout analyze --file src/server_logs.json --output report.txt
scout/
├── Cargo.toml
└── src/
├── main.rs # Entry point of the application
│ lib.rs # Library crate
├── cli.rs # Handles command-line interface logic
├── parser/ # Directory for log parsing functionalities
│ ├── mod.rs # Declares the parser module and sub-modules
│ └── json.rs # Specific parser for JSON logs
├── analyzer.rs # Analyzes parsed data
├── reporter.rs # Handles generating and outputting reports
└── server_logs.json # Example log file