SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


Sidebar

Recently Changed Pages:

View All Pages


View All Tags


LinkedIn




WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.


Pages with comments

View All Comments

apacheaccesslog

Apache Access Log Analysis

This is a small howto on how to analyze the amount of data requests for a webserver using the access log.

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
You could leave a comment if you were logged in.
apacheaccesslog.txt · Last modified: 2021/09/24 00:24 (external edit)