apacheaccesslog

Apache Access Log Analysis

Summary: This is a small howto on how to analyze the amount of data requests for a webserver using the access log.
Date: Around 2017
Refactor: 20 February 2025: Checked links and formatting.

Location Access Log

/var/log/apache2

Preparing Access Logs

If you need older logs as well, you'll need to unpack them. They are zipped using bzip. Uncompressing them is done like this:

bunzip2 access_log-20101226.bz2

Analyzing The Log

This is the command to get the requests per minute from the access log. The last sorts on the amount of requests per minute:

cat access_log | awk '{gsub("\\[",""); split($4,a,":");printf("%s:%s:%s %s\n",a[1],a[2],a[3] ,$1)}' | sort | uniq -c | sort -nk1,1
apacheaccesslog.txt · Last modified: by 127.0.0.1

Exception: Git command failed to perform periodic pull: From https://dev.azure.com/getshiftingcom/Documentation/_git/knowledge * branch main -> FETCH_HEAD fatal

Exception: Git command failed to perform periodic pull: From https://dev.azure.com/getshiftingcom/Documentation/_git/knowledge * branch main -> FETCH_HEAD fatal

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the gitbacked plugin.

More info has been written to the DokuWiki error log.