wok-current diff awstats-hotspot/stuff/loghotspot.sh @ rev 23479
updated python-dnspython (1.10.0 -> 1.16.0)
author | Hans-G?nter Theisgen |
---|---|
date | Sun Apr 05 15:53:47 2020 +0100 (2020-04-05) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/awstats-hotspot/stuff/loghotspot.sh Sun Apr 05 15:53:47 2020 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +#!/bin/sh 1.5 + 1.6 +HOTSPOT="hotspot" 1.7 +DIRDATA="/var/lib/awstats/$HOTSPOT" 1.8 + 1.9 +if [ "$1" == "--install" ]; then 1.10 + cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.$HOTSPOT.conf 1.11 + while read line; do 1.12 + sed -i "s,^${line%=*}.*,$line," /etc/awstats/awstats.$HOTSPOT.conf 1.13 + done <<EOT 1.14 +LogFile="$0 < /var/log/squid/access.log |" 1.15 +LogFormat="%code %time4 %bytesd %method %query %host %url" 1.16 +SiteDomain="$HOTSPOT" 1.17 +DirData="$DIRDATA" 1.18 +LevelForBrowsersDetection=0 1.19 +LevelForOSDetection=0 1.20 +LevelForRefererAnalyze=0 1.21 +LevelForRobotsDetection=0 1.22 +LevelForSearchEnginesDetection=0 1.23 +LevelForKeywordsDetection=0 1.24 +ShowRobotsStats=0 1.25 +ShowOSStats=0 1.26 +ShowBrowsersStats=0 1.27 +ShowOriginStats=0 1.28 +ShowKeyphrasesStats=0 1.29 +ShowKeywordsStats=0 1.30 +ShowMiscStats=0 1.31 +ShowHTTPErrorsStats=0 1.32 +EOT 1.33 +else 1.34 + while read time skip1 iprouter skip2 bytesd method query skip3 ; do 1.35 + host=$(echo $query | sed 's#.*//\([^/]*\)/.*#\1#') 1.36 + url=$(echo $query | sed 's#.*//##') 1.37 + echo "200 ${time%.*} $bytesd $method $query $host $url" 1.38 + done 1.39 +fi