Skip to content

Instantly share code, notes, and snippets.

@flyte
Created January 19, 2016 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flyte/197c23a4d403481af0ff to your computer and use it in GitHub Desktop.
Save flyte/197c23a4d403481af0ff to your computer and use it in GitHub Desktop.
Parse Apache logs to calculate number of hits.
#!/bin/bash
cd /var/log/apache2
i=`date +%d/%b/%Y`
j=`cat other_vhosts_access.log | grep “$i” | grep "GET / HTTP/1." | wc -l`
echo "No. of Apache Access Count:$j"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment