AWSTATS 问题:所有记录均已删除
我在使用 AWSTATS 分析我的 apache 日志时遇到问题。
过去一切都运转良好。
但现在我的服务器的日志格式已更改。
旧格式示例:
194.206.22.25 - - [14/12/2009:12:23:33 +0100]“GET /gPM-Systems/css/default.css HTTP/1.1”404 1036
新格式示例:
356652,mics,194.206.22.24,194.206.22.24,-,[05/Jul/2011:15:11:18 +0200],"GET /index.html HTTP/xx",302,-
对于旧格式好选择的 LogFormat 是 4。 现在是这样的自定义格式:
LogFormat="%other %other %host %other %logname %time1 %methodurl %代码”
我还更改了 LogSeparator 以设置“,”而不是“”。
我的问题是所有记录都被删除。
-showdropped 选项显示:
删除的记录(方法/协议“GET /apache_pb.gif”不合格 当LogType=W时): 356652,mics,194.206.22.24,194.206.22.24,-,[2011年7月05日:15:11:18 +0200],"GET /apache_pb.gif HTTP/1.0",302,-
I have a problem when using AWSTATS to analyse my apache logs.
In the past everything worked well.
But now the log format has changed for my server.
Old format example:
194.206.22.25 - - [14/Dec/2009:12:23:33 +0100] "GET /gPM-Systems/css/default.css HTTP/1.1" 404 1036
New format example:
356652,mics,194.206.22.24,194.206.22.24,-,[05/Jul/2011:15:11:18 +0200],"GET /index.html HTTP/x.x",302,-
For the old format the good LogFormat to choose was 4.
Now it is this custom format:
LogFormat="%other %other %host %other %logname %time1 %methodurl
%code"
I also changed the LogSeparator to set "," instead of " ".
My problem is that all records are dropped.
-showdropped option shows that:
Dropped record (method/protocol 'GET /apache_pb.gif' not qualified
when LogType=W):
356652,mics,194.206.22.24,194.206.22.24,-,[05/Jul/2011:15:11:18
+0200],"GET /apache_pb.gif HTTP/1.0",302,-
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当我更改日志格式时,我遇到了类似的问题。格式已更改,以及使用制表符作为字段分隔符,这导致了相同的错误。
对于 LogFile 配置选项,我已经使用了管道。因此,我通过在末尾添加
tr '\t' ' ' |
将选项卡切换为空格。然后我修改了 AWStats 配置以用空格分隔。此后我能够让 AWStats 解析日志。也许它也适合你。
如果您尚未将管道用于
LogFile
配置选项,则可以使用cat
将文件放入tr
中。I had a similar issue when I changed the format of my logs. The format was changed, as well as using tab as the field separator, and this caused the same error.
For the
LogFile
configuration option, I was already using a pipe. So I switched the tab out for a space by addingtr '\t' ' ' |
to the end. Then I modified the AWStats config to separate on spaces.I was able to get AWStats to parse the logs after this. Perhaps it will work for you as well.
If you are not already using a pipe for the
LogFile
configuration option, you can usecat
to get the files intotr
.替换 HTTP/1.x 不解决这个问题
Replace HTTP/1.x with nothing solve this issue