diff options
| -rwxr-xr-x | openbsd/frontends/scripts/sitestats.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsd/frontends/scripts/sitestats.sh b/openbsd/frontends/scripts/sitestats.sh index 8a8a31b..4859201 100755 --- a/openbsd/frontends/scripts/sitestats.sh +++ b/openbsd/frontends/scripts/sitestats.sh @@ -68,6 +68,16 @@ ip_stats () { done } +ip_daily_stats () { + echo "Unique IPs by day" + for back in $(jot 90); do + now=$(date +%s) + date=$(date -r $(echo "$now - 86400 * $back" | bc) +%d,%b) + echo -n "\t $date:" + stats | grep $date | cut -d, -f3 | sort -u | wc -l + done +} + main () { parse_logs filter @@ -80,6 +90,7 @@ main () { stats | top_n '1,7' stats | top_n '1,2,7' ip_stats + ip_daily_stats } main |
