awstats不解析logformat操作系统,移动浏览器,机器人,keyworks

时间:2013-02-27 21:15:43

标签: apache awstats

我在组合模式中使用logfomat进行Apache配置:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

此结果日志中的示例:

192.168.201.156 - - [02/Feb/2013:00:00:10 -0430] "GET /conseme/styles/datePicker.css HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:11 -0430] "GET /conseme/styles/calendario.css HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:11 -0430] "GET /conseme/styles/windows_modal.css HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:11 -0430] "GET /conseme/styles/confirm.css HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:11 -0430] "GET /conseme/js/jquery/jquery.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:11 -0430] "GET /conseme/js/jquery/jquery.min.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:12 -0430] "GET /conseme/js/calendario/date.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:12 -0430] "GET /conseme/js/calendario/jquery.datepicker.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:12 -0430] "GET /conseme/js/jquery.maskedinput.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.201.156 - - [02/Feb/2013:00:00:13 -0430] "GET /conseme/js/Validador.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.202.244 - - [02/Feb/2013:00:00:13 -0430] "GET /portalasegurado/3/BOTPAGO/50/50.10/opcion.do HTTP/1.1" 200 1837 "http://myserver.com.com:49004/portalasegurado/menu.do" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6; BTRS129265; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; AskTbBCPA/5.14.1.20007; 89770703; compat/4.1.08010)"
192.168.202.244 - - [02/Feb/2013:00:00:13 -0430] "GET /portalasegurado/styles/style.css HTTP/1.1" 200 1228 "http://myserver.com.com:49004/portalasegurado/3/BOTPAGO/50/50.10/opcion.do" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6; BTRS129265; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; AskTbBCPA/5.14.1.20007; 89770703; compat/4.1.08010)"
192.168.201.156 - - [02/Feb/2013:00:00:13 -0430] "GET /conseme/js/validation.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
192.168.202.244 - - [02/Feb/2013:00:00:13 -0430] "GET /portalasegurado/js/jquery/jquery.min.js HTTP/1.1" 200 26048 "http://myserver.com.com:49004/portalasegurado/3/BOTPAGO/50/50.10/opcion.do" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6; BTRS129265; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; AskTbBCPA/5.14.1.20007; 89770703; compat/4.1.08010)"
192.168.201.156 - - [02/Feb/2013:00:00:13 -0430] "GET /conseme/js/interfaz.js HTTP/1.1" 304 0 "http://myserver.com.com:49004/conseme/iniciar.do?APP_CODE=ICA&pms=9eew1896ugjew8SxfYG2s8XxdYML4qZAVEX4lbkZUGo&aux=SM010213235332219&incrustado=1&usession=6172996210449710866&mainappcode=PORTPROV" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"

awstats的logformat与配置文件示例相同:

LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"

此匹配与apache输出完美匹配,精确设置部分 (机器人,浏览器,操作系统,引用,文件类型)检测每个属性的值为2。我尝试使用LevelForBrowsersDetection = allphones进行测试,而无法使用移动浏览器进行检测

我运行awstats.pl来构建数据库:

perl C:\mysoft\awstats-7.1\wwwroot\cgi-bin\awstats.pl -config=www.myserver.com -lang=en -staticlinks -update -month=2 -year=2013 ^
LogFile="C:\mysoft\awstats-7.1\tools\logresolvemerge.pl -showsteps C:\temp\awstats\log\2013\02\* |"

接下来运行builstatic_pages以生成html完整报告

perl C:\mysoft\awstats-7.1\tools\awstats_buildstaticpages.pl -awstatsprog=C:\mysoft\awstats-7.1\wwwroot\cgi-bin\awstats.pl ^
-config=www.myserver.com -lang=en -staticlinks -output -month=2 -year=2013 -dir=.\stats\2013\02  1>awstats_buildstaticpages_last_execution.log

所有这些都运行正常,但在主HTML页面中的部分:

  • 操作系统:仅显示未知
  • 浏览器:没有检测到移动设备/手机和版本,显示未知与IE,Safari,Chrome,FF和Opera的所有差异。
  • 来自互联网搜索引擎的链接:为空。查看日志,Google和其他人都有参考文献。
  • 搜索关键短语:空白
  • 搜索关键字:空白

我的系统环境是:   - Windows 7 64b并在Windows Server 2003 32b上进行测试   - ActivePerl-5.16.2.1602-MSWin32-x86-296513   - Awstats-7.1

我试图找到相关的互联网问题,但未成功。
请让我知道任何想法,对我的移动浏览器和操作系统系列/类型很重要 感谢

1 个答案:

答案 0 :(得分:0)

如果您使用高于5.12.4的perl版本且awstats低于或等于7.1,则您当前将丢失操作系统和搜索引擎检测的统计信息。

然后是2个解决方案:

  • 降级perl
  • 将awstats升级为> = 7.1.1

见: