diff options
| author | Paul Buetow <openbsd@mx.buetow.org> | 2022-01-29 22:00:00 +0100 |
|---|---|---|
| committer | Paul Buetow <openbsd@mx.buetow.org> | 2022-01-29 22:00:00 +0100 |
| commit | af731bc87ef2a5d29e6ead152a351f856d7c9b5c (patch) | |
| tree | e47a697baf4e9fbda3ed88db4ededb76c42f5034 /openbsd | |
| parent | b114ca094378a4e9709a14dc5f24aa596253c34f (diff) | |
subscribers per day added
Diffstat (limited to 'openbsd')
| -rwxr-xr-x | openbsd/frontends/scripts/sitestats.sh | 15 |
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//' |
