设为首页 收藏本站
查看: 1536|回复: 0

[经验分享] awstats日志分析小结(2)

[复制链接]

尚未签到

发表于 2017-5-21 11:53:44 | 显示全部楼层 |阅读模式
awstats以默认方式对日志统计分析的时候,有时无法满足我们业务的需求(对URL中某些参数进行统计分析)。所以需要对awstats扩展部分进行定义,从而使其满足我们的需要。
awstats.xxx.conf关于EXTRA SECTIONS的描述部分

#-----------------------------------------------------------------------------
# EXTRA SECTIONS
#-----------------------------------------------------------------------------

# You can define your own charts, you choose here what are rows and columns
# keys. This feature is particularly useful for marketing purpose, tracking
# products orders for example.
# For this, edit all parameters of Extra section. Each set of parameter is a
# different chart. For several charts, duplicate section changing the number.
# Note: Each Extra section reduces AWStats speed by 8%.
#
# WARNING: A wrong setup of Extra section might result in too large arrays
# that will consume all your memory, making AWStats unusable after several
# updates, so be sure to setup it correctly.
# In most cases, you don't need this feature.
#
# ExtraSectionNameX is title of your personalized chart.
# ExtraSectionCodeFilterX is list of codes the record code field must match.
#   Put an empty string for no test on code.
# ExtraSectionConditionX are conditions you can use to count or not the hit,
#   Use one of the field condition
#   (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,extraX)
#   and a regex to match, after a coma. Use "||" for "OR".
# ExtraSectionFirstColumnTitleX is the first column title of the chart.
# ExtraSectionFirstColumnValuesX is a string to tell AWStats which field to
#   extract value from
#   (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,VHOST,extraX)
#   and how to extract the value (using regex syntax). Each different value
#   found will appear in first column of report on a different row. Be sure
#   that list of different possible values will not grow indefinitely.
# ExtraSectionFirstColumnFormatX is the string used to write value.
# ExtraSectionStatTypesX are things you want to count. You can use standard
#   code letters (P for pages,H for hits,B for bandwidth,L for last access).
# ExtraSectionAddAverageRowX add a row at bottom of chart with average values.
# ExtraSectionAddSumRowX add a row at bottom of chart with sum values.
# MaxNbOfExtraX is maximum number of rows shown in chart.
# MinHitExtraX is minimum number of hits required to be shown in chart.
#

# Example to report the 20 products the most ordered by "order.cgi" script
#ExtraSectionName1="Product orders"
#ExtraSectionCodeFilter1="200 304"
#ExtraSectionCondition1="URL,\/cgi\-bin\/order\.cgi||URL,\/cgi\-bin\/order2\.cgi"
#ExtraSectionFirstColumnTitle1="Product ID"
#ExtraSectionFirstColumnValues1="QUERY_STRING,productid=([^&]+)"
#ExtraSectionFirstColumnFormat1="%s"
#ExtraSectionStatTypes1=PL
#ExtraSectionAddAverageRow1=0
#ExtraSectionAddSumRow1=1
#MaxNbOfExtra1=20
#MinHitExtra1=1
在我们的项目中需要对包含某些特定参数的部分进行统计,如下是我们实际项目中配置文件添加的部分。

#扩展表格1的标题
ExtraSectionName1="Product orders scene"
#过滤返回码 200,304的纪录
ExtraSectionCodeFilter1="200 304"
#过滤URL包含dataservlet 或 sceneservlet的纪录
ExtraSectionCondition1="URL,dataservlet||URL,sceneservlet"
#标题名称
ExtraSectionFirstColumnTitle1="scene"
#过滤参数为scene
ExtraSectionFirstColumnValues1="QUERY_STRING,scene=([^&]+)"
ExtraSectionFirstColumnFormat1="%s"
ExtraSectionStatTypes1=1
ExtraSectionAddAverageRow1=1
ExtraSectionAddSumRow1=1
MaxNbOfExtra1=20
MinHitExtra1=1

#扩展表格2的标题
ExtraSectionName2="Product orders vmethod"
ExtraSectionCodeFilter2="200 304"
ExtraSectionCondition2="URL,dataservlet||URL,sceneservlet"
ExtraSectionFirstColumnTitle2="vmethod"
ExtraSectionFirstColumnValues2="QUERY_STRING,vmethod=([^&]+)"
ExtraSectionFirstColumnFormat2="%s"
ExtraSectionStatTypes2=1
ExtraSectionAddAverageRow2=1
ExtraSectionAddSumRow2=1
MaxNbOfExtra2=20
MinHitExtra2=1

#扩展表格3的标题
ExtraSectionName3="Product orders dataset"
ExtraSectionCodeFilter3="200 304"
ExtraSectionCondition3="URL,dataservlet||URL,sceneservlet"
ExtraSectionFirstColumnTitle3="dataset"
ExtraSectionFirstColumnValues3="QUERY_STRING,dataset=([^&]+)"
ExtraSectionFirstColumnFormat3="%s"
ExtraSectionStatTypes3=1
ExtraSectionAddAverageRow3=1
ExtraSectionAddSumRow3=1
MaxNbOfExtra3=20
MinHitExtra3=1
注意各个参数以已1,2,3...结尾,分别标示为各扩展表的属性。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-379572-1-1.html 上篇帖子: Awstats的日志分析工具包 下篇帖子: 自动运行awstats统计程序的问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表