Using grep (not sed) to grab IP addresses from Apache web logs

Today I ran the following command to see how many people accessed the ProgClub wiki over the previous 5 hours:


jj5@charity:/var/log/apache2$ grep "GET /wiki/" access.log |
 grep "13/Jul/2013:0" | grep -Eo '^([0-9]{1,3}\.){3}[0-9]{1,3}' | sort | uniq | wc

Leave a Reply