Spyderserve Web Development

How to show the top 10 IP addresses in an Apache Log

Sometimes I just want to see what IP address is generating the most traffic to my site.  Here is the awk command to do it:

awk '{a[$1]++} END {for (i in a) print a[i],i}' [file] | sort -rnk1 | head -n 15

The command above will show the top 15 visitors, by IP address (replace [file] witht he relative path to the log you want to analyze.

Source: https://stackoverflow.com/questions/22896955/apache-access-log-for-the-most-common-ip-address-bash-script?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Spyderserve  PO Box 5831 Valdosta, Georgia 31603 United States