This Rust command-line tool is designed to analyze log files by counting the occurrences of different log levels (e.g., INFO
, WARN
, ERROR
). It parses the log entries, identifies the log level, and generates a summary of log level frequencies. The tool can process logs in standard formats, making it useful for quickly understanding the distribution of log messages within a file.
- Log Level Counting: Counts occurrences of
INFO
,WARN
,ERROR
, and other log levels. - Log Entry Parsing: Parses log entries based on a standard timestamp and log level format.
- Summary Generation: Outputs a summary of log level counts to the console.
--log <logfile>
: Specifies the path to the log file you want to analyze.
To run the tool and analyze a log file:
cargo run -- --log path_to_your_log_file.log
Replace path_to_your_log_file.log
with the actual path to your log file.
After running the tool, you’ll see a summary like this:
Log Level Summary:
INFO: 150
WARN: 23
ERROR: 7
- Clone this repository:
git clone https://github.com/konkked/logrok.git
- Navigate to the project directory:
cd logrok
- Build the project:
cargo build
- Run the tool with your log file:
cargo run -- --log path_to_your_log_file.log
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.
This project is licensed under the MIT License.