Created
December 9, 2010 20:24
-
-
Save tresni/735276 to your computer and use it in GitHub Desktop.
Allows you to easily search through your OpenDNS stats for the total number of requests in given months to domains containing a specified string. This requires the fetchstats script from http://github.com/opendns/opendns-fetchstats .
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: ./fetchstats-condensor [USERNAME] [NEEDLE] [LIST_OF_NETWORKS] [LIST OF MONTHS] | |
# Example: ./fetchstats-condensor example google\.com "all 1" "2010-01 2010-02 2010-03" | |
USERNAME=$1 | |
NEEDLE=$2 | |
NETWORKS=$3 | |
MONTHS=$4 | |
echo -n "Password for $1: " >&2 | |
stty -echo | |
read PASSWORD | |
stty echo | |
echo >&2 | |
for network in $NETWORKS | |
do | |
for month in $MONTHS | |
do | |
echo -n "$network, $month, " | |
echo $PASSWORD | \ | |
./fetchstats $USERNAME $network $month-01 $month-31 2> /dev/null | \ | |
grep $NEEDLE | \ | |
awk '{FS=","; total = total + $3 } END { printf total }' | |
echo | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment