Skip to content
Simple console based web log interpreter
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
weblog.py

README.md

Console Web Log Analyzer

For those who want to analyze their Common Log Format web logs without having to use web based graphical tools such as awstats. This is a simple console based web log analyzer. Output is somewhat in markdown so you can also use this to generate pages, with cron or whatever.

Requires python 2.7 and numpy

Options

-l: log file to analyze. Defaults to ./access_log
-x: perform reverse DNS lookup on IP addresses
-C: show all unique visitors in output
-c x: show 'x' top accessing visitors
-R: show all unique accessed resources -r y: show 'y' top accessed resources
-b z: Use maximum of 'z' x characters in the bar charts (adjust if default overruns a line)
-v: show version information and exit

Note: Using -x with -C will be slow if you have a big log file.

Examples

% ./weblog.py -l access_log
Simply parse a log file and output to the terminal

$ ./weblog.py -xl access_log > out.md
$ discount-mkd2html out.md
Running these two commands will create the HTML file out.html in the running directory.

Bugs

  • The output, if translated to HTML from Markdown, would look better if Markdown supported tables.

  • Does it do IPv6 the right way?

You can’t perform that action at this time.