Skip to content
/ readlog Public

πŸ” Log Monitoring with Rust: A program that monitors a log file, extracts the `remote_ip`, and records it to a result file.

Notifications You must be signed in to change notification settings

oarinv/readlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Log Monitoring with Rust

This is a Rust program that monitors a log file and extracts the remote_ip from log lines that match certain criteria. It writes the extracted remote_ip values to a result file, ensuring that each remote_ip is recorded only once.

Features

  • Monitors a log file for changes.
  • Extracts remote_ip from log lines that contain specific criteria.
  • Writes the extracted remote_ip values to a result file.
  • Ensures that each remote_ip is recorded only once.

Requirements

  • Rust (stable)
  • Cargo

Usage

  1. Clone the repository:

    git clone https://github.com/oarinv/readlog.git
  2. Navigate to the project directory:

    cd readlog
  3. Modify the log_file_path and result_file_path variables in the main function of src/main.rs to specify the paths of your log file and result file.

  4. Build and run the program:

    cargo run

The program will start monitoring the log file and write the extracted remote_ip values to the result file.

  1. To stop the program, press Ctrl + C.

Customization

  • You can modify the criteria for matching log lines by editing the conditions in the if statement in the main function of src/main.rs.
  • Additional processing logic can be added after writing each remote_ip value to the result file.

License

This project is licensed under the MIT License.

About

πŸ” Log Monitoring with Rust: A program that monitors a log file, extracts the `remote_ip`, and records it to a result file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages