summaryrefslogtreecommitdiff
path: root/openbsd
diff options
context:
space:
mode:
authorPaul Buetow <openbsd@mx.buetow.org>2022-01-29 20:55:00 +0100
committerPaul Buetow <openbsd@mx.buetow.org>2022-01-29 20:55:00 +0100
commit8f727e6eb47b93b2157ef9b3b0d7e1e8b72555a8 (patch)
tree227e750d5b97d8ee7ff74469bc7aafb87689a511 /openbsd
parent8a2fd2555ab5af0bfdc5fac7a3f8719dda994603 (diff)
add ip per day stats
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/frontends/scripts/sitestats.sh11
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