awstats分析历史日志的处理办法
来源:互联网 发布:意大利脱欧 知乎 编辑:程序博客网 时间:2024/06/07 10:54
今天查看awstats访问量统计分析系统时,发现从2013年5月15号就没数据了,查看配置文件发现参数值里指定了日志为5月14日,中间插了5个多月的数据,需要重新分析。
当时就跑了一个昨天(2013.11.5)的日志,跑完后在系统上就能看见昨天的访问量,就是系统里缺少2013.5.15-2013.11.4的数据。但是此时在分析2013.5.15的日志系统是不会显示的。
处理办法:
查看/etc/awstats的配置文件中DataDir配置项为DirData="/logs/awstats"
这个目录下的文件是awstats的网页分析数据,相当于系统的数据库,文件以awstats月份+年份.域名.txt
修改最新的数据文件,找到LastTime项如下
LastTime 20130531175501
LastTime就是日志最晚分析时间,将此项改为2013年5月14日就可以更新5月14号的日志文件了
awstats.pl参数选项如下:
Options to update statistics: -update to update statistics (default) -showsteps to add benchmark information every 8192 lines processed -showcorrupted to add output for each corrupted lines found, with reason -showdropped to add output for each dropped lines found, with reason -showunknownorigin to output referer when it can't be parsed -showdirectorigin to output log line when origin is a direct access -updatefor=n to stop the update process after parsing n lines -LogFile=x to change log to analyze whatever is 'LogFile' in config file Be care to process log files in chronological order when updating statistics.
下面准备批量分析日志的脚本
将需要分析的日志文明导入loglist文件如下:
logfilelocalhost_20130515.loglocalhost_20130516.loglocalhost_20130517.loglocalhost_20130518.loglocalhost_20130519.loglocalhost_20130520.loglocalhost_20130521.loglocalhost_20130522.loglocalhost_20130523.loglocalhost_20130524.loglocalhost_20130525.loglocalhost_20130526.loglocalhost_20130527.loglocalhost_20130528.loglocalhost_20130529.loglocalhost_20130530.loglocalhost_20130531.loglocalhost_20130601.loglocalhost_20130602.loglocalhost_20130603.loglocalhost_20130604.loglocalhost_20130605.loglocalhost_20130606.loglocalhost_20130607.loglocalhost_20130608.loglocalhost_20130609.loglocalhost_20130610.loglocalhost_20130611.loglocalhost_20130612.loglocalhost_20130613.loglocalhost_20130614.loglocalhost_20130615.loglocalhost_20130616.loglocalhost_20130617.log
。。。。。。。
脚本文件getresulet.sh如下:
#!/bin/bashwhile read logfile do perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=localhost -LogFile=/logs/$logfiledone <list1
执行getresulet.sh成功。
- awstats分析历史日志的处理办法
- AWStats: Apache/IIS的日志分析工具
- AWStats: Apache/IIS的日志分析工具
- 使用 awstats 分析 Nginx 的访问日志
- 使用 awstats 分析 Nginx 的访问日志
- 使用 awstats 分析 Nginx 的访问日志
- 强大的日志分析工具AWStats
- 使用AWStats分析Nginx的访问日志
- 强大的日志分析工具AWStats
- 日志分析-awstats-7.5的安装使用
- 基于Awstats的Tomcat8-Java8日志分析
- awstats分析nginx日志
- awstats-日志分析软件
- 日志分析系统 --- AWStats
- Awstats分析Nginx日志
- awstats分析nginx日志
- Awstats分析nginx日志
- awstats分析apche日志
- 导出表中数据到sql文件
- scanf
- django 存储数据时 报 IntergrityErrror错误
- Jquery实现表格header头随滚动条滚动而滚动
- hdu 4123 Bob’s Race(树形DP&RMQ)
- awstats分析历史日志的处理办法
- Openbravo Smartclient 使用总结(1) - Summary
- MySQL数据库的IO操作
- Unable to execute dex: Multiple dex files define Lcom/jayway/android/robotium/solo/ActivityUtils$1错误
- RTMPdump 使用说明
- 用ASIHttpRequest实现数据缓存和队列
- Android事件分发机制完全解析,带你从源码的角度彻底理解(下) 。
- PHP die() 函数
- uboot中编译器EABI问题相关说明