wok annotate awstats-hotspot/stuff/loghotspot.sh @ rev 17212

cyrus-imapd: enable murder
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 10 15:22:16 2014 +0200 (2014-10-10)
parents
children
rev   line source
pascal@12973 1 #!/bin/sh
pascal@12973 2
pascal@12973 3 HOTSPOT="hotspot"
pascal@12973 4 DIRDATA="/var/lib/awstats/$HOTSPOT"
pascal@12973 5
pascal@12973 6 if [ "$1" == "--install" ]; then
pascal@12973 7 cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.$HOTSPOT.conf
pascal@12973 8 while read line; do
pascal@12973 9 sed -i "s,^${line%=*}.*,$line," /etc/awstats/awstats.$HOTSPOT.conf
pascal@12973 10 done <<EOT
pascal@12973 11 LogFile="$0 < /var/log/squid/access.log |"
pascal@12973 12 LogFormat="%code %time4 %bytesd %method %query %host %url"
pascal@12973 13 SiteDomain="$HOTSPOT"
pascal@12973 14 DirData="$DIRDATA"
pascal@12973 15 LevelForBrowsersDetection=0
pascal@12973 16 LevelForOSDetection=0
pascal@12973 17 LevelForRefererAnalyze=0
pascal@12973 18 LevelForRobotsDetection=0
pascal@12973 19 LevelForSearchEnginesDetection=0
pascal@12973 20 LevelForKeywordsDetection=0
pascal@12973 21 ShowRobotsStats=0
pascal@12973 22 ShowOSStats=0
pascal@12973 23 ShowBrowsersStats=0
pascal@12973 24 ShowOriginStats=0
pascal@12973 25 ShowKeyphrasesStats=0
pascal@12973 26 ShowKeywordsStats=0
pascal@12973 27 ShowMiscStats=0
pascal@12973 28 ShowHTTPErrorsStats=0
pascal@12973 29 EOT
pascal@12973 30 else
pascal@12973 31 while read time skip1 iprouter skip2 bytesd method query skip3 ; do
pascal@12973 32 host=$(echo $query | sed 's#.*//\([^/]*\)/.*#\1#')
pascal@12973 33 url=$(echo $query | sed 's#.*//##')
pascal@12973 34 echo "200 ${time%.*} $bytesd $method $query $host $url"
pascal@12973 35 done
pascal@12973 36 fi