summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <openbsd@mx.buetow.org>2022-01-29 22:00:00 +0100
committerPaul Buetow <openbsd@mx.buetow.org>2022-01-29 22:00:00 +0100
commitaf731bc87ef2a5d29e6ead152a351f856d7c9b5c (patch)
treee47a697baf4e9fbda3ed88db4ededb76c42f5034
parentb114ca094378a4e9709a14dc5f24aa596253c34f (diff)
subscribers per day added
-rwxr-xr-xopenbsd/frontends/scripts/sitestats.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/openbsd/frontends/scripts/sitestats.sh b/openbsd/frontends/scripts/sitestats.sh
index da87473..7f154e6 100755
--- a/openbsd/frontends/scripts/sitestats.sh
+++ b/openbsd/frontends/scripts/sitestats.sh
@@ -45,7 +45,7 @@ filter () {
# Filte out all bot IPs, also only filter out all known file "types".
grep -F -v -f $BOTSFILE $STATSFILE > $STATSFILE.clean1
- grep -v -E '(proto,host|\.suffix|atom\.xml|\.gif|\.png|\.jpg)' $STATSFILE.clean1 > $STATSFILE.dirt
+ grep -v -E '(proto,host|\.suffix|atom\.xml|\.gif|\.png|\.jpg|,,)' $STATSFILE.clean1 > $STATSFILE.dirt
#grep -E '(proto,host|\.suffix|atom\.xml|\.gif|\.png|\.jpg)' $STATSFILE.clean1 > $STATSFILE.clean2
mv $STATSFILE.clean1 $STATSFILE
}
@@ -82,12 +82,20 @@ ip_daily_stats () {
done
}
+ip_daily_subscribers () {
+ echo "Unique atom.xml subscribers 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 | grep atom.xml | cut -d, -f3 | sort -u | wc -l
+ done
+}
+
main () {
parse_logs
filter
stats | grep -F .suffix | top_n '1,2,4,5,7' ' (Only content)'
- stats | grep -F atom.xml | top_n '1,2,4,5,7' ' (Only atom.xml)'
- stats | top_n 1
stats | top_n 2
stats | top_n '4,5'
stats | top_n 7
@@ -95,6 +103,7 @@ main () {
stats | top_n '1,2,7'
ip_stats
ip_daily_stats
+ ip_daily_subscribers
}
main | sed 's/\.suffix//'