Many pieces of software exist that can take an existing Apache httpd (or other) logs in the Common Log format or Combined log format, parse them, and then do something with them. I find it convenient to be able to do this with pure Python, using a package that can be installed from pip.
- Replay requests against a new server
- Count log entries
- Filter based on start and end dates
- Print logs with a new canonical server URL
Installation is normal:
pip install apache-replay
Generate usage with:
apache-replay --help
Count the number of requests in November of 2018:
apache-replay --player count https://site.com/ /var/logs/httpd/access_log.2018-11*
Replay those same logs (only GET, HEAD, OPTIONS) against qa-mysite.com:
apache-replay https://qasite.com/ /var/logs/httpd/access_log.2018-11*
Only replay 2000 log entries from that file
apache-replay --count 2000 https://qasite.com/ /var/logs/httpd/access_log.2018-11*
MIT License