wok view awstats-hotspot/stuff/loghotspot.sh @ rev 21534

consolekit2 modified BUILD_DEPENDS
author Hans-G?nter Theisgen
date Sun May 05 11:13:36 2019 +0100 (2019-05-05)
parents
children
line source
1 #!/bin/sh
3 HOTSPOT="hotspot"
4 DIRDATA="/var/lib/awstats/$HOTSPOT"
6 if [ "$1" == "--install" ]; then
7 cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.$HOTSPOT.conf
8 while read line; do
9 sed -i "s,^${line%=*}.*,$line," /etc/awstats/awstats.$HOTSPOT.conf
10 done <<EOT
11 LogFile="$0 < /var/log/squid/access.log |"
12 LogFormat="%code %time4 %bytesd %method %query %host %url"
13 SiteDomain="$HOTSPOT"
14 DirData="$DIRDATA"
15 LevelForBrowsersDetection=0
16 LevelForOSDetection=0
17 LevelForRefererAnalyze=0
18 LevelForRobotsDetection=0
19 LevelForSearchEnginesDetection=0
20 LevelForKeywordsDetection=0
21 ShowRobotsStats=0
22 ShowOSStats=0
23 ShowBrowsersStats=0
24 ShowOriginStats=0
25 ShowKeyphrasesStats=0
26 ShowKeywordsStats=0
27 ShowMiscStats=0
28 ShowHTTPErrorsStats=0
29 EOT
30 else
31 while read time skip1 iprouter skip2 bytesd method query skip3 ; do
32 host=$(echo $query | sed 's#.*//\([^/]*\)/.*#\1#')
33 url=$(echo $query | sed 's#.*//##')
34 echo "200 ${time%.*} $bytesd $method $query $host $url"
35 done
36 fi