lots of tech info here

Parsing Web Server Logs

This is assuming your webserver log is access.log.

Extract unique IP addresses from the webserver log:

  cat access.log | awk '{print $1}' | uniq

Count number of unique IP addresses from log:

  cat access.log | awk '{print $1}' | uniq | wc -l

List the IP addresses of users using iPhones:

  cat access.log | grep -i iphone | awk '{print $1}' | uniq | sort

Count number of IP addresses of visitors who have a 444 error:

  grep '444 0' access.log | awk '{print $1}' | sort -n | uniq -c | sort -n

Updated on 10 Jun 2015 {Created on 01 Jun 2009}

If you liked this article, subscribe to our Feed, follow us on Twitter (@aruljohn) and/or join our Facebook Page.

Share this with Others

Subscribe

Tags