Skip to content

Python script to parse through a Web log file (apache or nginx for now) and return the number of requests and unique IPs in a given time period

Notifications You must be signed in to change notification settings

mattjay/WebLogStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

Web Log Stats

Python script to parse through a web log file and return the number of requests and unique IPs in a given time period

It takes web (apache or nginx for now) log files via -f, the number of hours back you'd like to look -t (Default = 24 hours), and if you want the actual list of unique IPs -i or a list of the Top N most common IPs via -n

Options:

-h, --help  show this help message and exit
-i, --ips   shows list of unique IPs
-t HOURS    number of hours back you want to look
-n IPS      List the n most common IPs to visit in the given time period
-f FILES, --files=FILES
       		list of apache log file paths

Usage Examples:

python webStats.py -f "httpd-access.log"
python webStats.py -i -t 48 -n 10 -f "../path/to/httpd-access.log.0, ../path/to/httpd-access.log.1"

About

Python script to parse through a Web log file (apache or nginx for now) and return the number of requests and unique IPs in a given time period

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages