Skip to content

Instantly share code, notes, and snippets.

@bmvakili
Last active August 29, 2015 14:27
Show Gist options
  • Save bmvakili/e7fe92cb54207b8da699 to your computer and use it in GitHub Desktop.
Save bmvakili/e7fe92cb54207b8da699 to your computer and use it in GitHub Desktop.
Parse Unique Visitors from Apache
APACHE_LOG_FILE=/var/log/apache2/jenkinsrow-access_log
LINES_TO_SCAN=100000
EXCLUDED_ENTITIES="(router.asus.com|NewRelicPinger|Googlebot|slurp|spider|bingbot)"
tail $APACHE_LOG_FILE -n $LINES_TO_SCAN | egrep -v "$EXCLUDED_ENTITIES" | sed -r 's!^[^ ]* ([^ ]*) .*!\1!g' | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment