https://github.com/samsoft00/web-server-access-log-parser
The goal is to write a parser in Java that parses web server access log file, loads the log to MySQL and checks if a given IP makes more than a certain number of requests for the given duration.
https://github.com/samsoft00/web-server-access-log-parser
Last synced: 3 months ago
JSON representation
The goal is to write a parser in Java that parses web server access log file, loads the log to MySQL and checks if a given IP makes more than a certain number of requests for the given duration.
- Host: GitHub
- URL: https://github.com/samsoft00/web-server-access-log-parser
- Owner: samsoft00
- Created: 2017-10-09T02:43:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T12:40:40.000Z (over 7 years ago)
- Last Synced: 2025-02-10T00:44:30.088Z (5 months ago)
- Language: Java
- Size: 3.01 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Web-Server-Access-Log-Parser
The goal is to write a parser in Java that parses web server access log file, loads the log to MySQL and checks if a given IP makes more than a certain number of requests for the given duration.Solution
![]()
==========================================================Developer: Oyewole Abayomi Samuel.
Position: Senior Java Developer.
Country: Nigeria.
Skype: [email protected]
Date: 2017-05-10
---------------------------------
Deliverables
---------------------------------(1) Java program that can be run from command line
HOW TO RUN JAVA PROGRAM FROM CMD - USER MANUAL
==================================================1. Extract the .jar file into a directory e.g Desktop/Download directory
2. Launch MYSQL client using Xampp OR Wampp, ensure MYSQL is on runing port - 3306
3. Create Database using this SQL below (See full information below)
CREATE DATABASE weblogs;
4. Next, open your favorite command line, cd into directory where you have parser.jar and run the following command.
java -cp "parser.jar" com.ef.Parser --accesslog="/path/to/file" --startDate=2017-01-01.13:05:00 --duration=hourly --threshold=100
Please note that the default MYSQL credential is
MYSQL Username: 'root'
MYSQL Password: ''
You can config your MYSQL client to use above credentials or run the program to dynamically by including MYSQL credentials at run time like this
java -cp "parser.jar" com.ef.Parser --accesslog="/path/to/file" --startDate=2017-01-01.13:05:00 --duration=hourly --threshold=100 --dbUser=root --dbPass=mysql