This script takes a logfile as input and can output 1 of 3 things
- Total requests aggregated by day
- Top 3 user agents over time
- Ratio of GETS/POSTS over time
Python 2.7
Modules: import collections import datetime import re import sys import argparse
usage: log_parser.py [-h] --file FILE
{get_daily_requests,get_user_agents,get_ratio} ...
get_daily_requests Get total daily requests
get_user_agents Get top 3 user agents
get_ratio Get ratio of GETS/POSTS
-h, --help show this help message and exit --file FILE, -f FILE Enter a filename
python log_parser.py -f sample.log get_daily_requests
- Thanks for the opportunity to work on this !