Apache的Access.log分析总结

#查看80端口的tcp连接

#netstat -tan | grep "ESTABLISHED" | grep ":80" | wc -l

1

#当前WEB服务器中联接次数最多的ip地址:

#netstat -ntu |awk '{print $5}' |sort | uniq -c| sort -n -r

231 ::ffff:127.0.0.1:8095

23 ::ffff:192.168.50.201:5432

2 ::ffff:192.168.50.203:80

1 servers)

1 ::ffff:192.168.50.56:43314

1 ::ffff:192.168.50.21:2996

1 ::ffff:192.168.50.21:2989

1 ::ffff:192.168.50.200:8060

1 ::ffff:192.168.50.12:1300

1 ::ffff:192.168.50.12:1299

1 ::ffff:192.168.50.12:1298

1 ::ffff:127.0.0.1:57933

1 Address

1 192.168.50.41:65310

1 192.168.50.41:64949

1 192.168.50.41:49653

#查看日志中访问次数最多的前10个IP

#cat access_log |cut -d ' ' -f 1 |sort |uniq -c | sort -nr | awk '{print $0 }' | head -n 10 |less

14085 121.207.252.122

13753 218.66.36.119

11069 220.162.237.6

1188 59.63.158.118

1025 ::1

728 220.231.141.28

655 114.80.126.139

397 117.25.55.100

374 222.76.112.211

348 120.6.214.70

#查看日志中出现100次以上的IP

#cat access_log |cut -d ' ' -f 1 |sort |uniq -c | awk '{if ($1 > 100) print $0}'|sort -nr |less

14085 121.207.252.122

13753 218.66.36.119

11069 220.162.237.6

1188 59.63.158.118

1025 ::1

728 220.231.141.28

655 114.80.126.139

397 117.25.55.100

374 222.76.112.211

348 120.6.214.70

252 58.211.82.150

252 159.226.126.21

206 121.204.57.94

192 59.61.111.58

186 218.85.73.40

145 221.231.139.30

134 121.14.148.220

123 222.246.128.220

122 61.147.123.46

119 121.204.105.58

107 116.9.75.237

105 118.123.5.173

#查看最近访问量最高的文件

#cat access_log |tail -10000|awk '{print $7}'|sort|uniq -c|sort -nr|less

8729 /server-status?auto

618 /

15 /favicon.ico

12 /manager/html

10 *

9 /top/icons.gif

8 /www.766.com/awstats.www.766.com.html

8 /awstatsicons/other/vv.png

8 /awstatsicons/other/vu.png

8 /awstatsicons/other/vp.png

8 /awstatsicons/other/vk.png

8 /awstatsicons/other/vh.png

8 /awstatsicons/other/hx.png

8 /awstatsicons/other/hp.png

8 /awstatsicons/other/hk.png

8 /awstatsicons/other/hh.png

8 /awstatsicons/other/he.png

8 /awstatsicons/other/awstats_logo6.png

8 /awstatsicons/os/win.png

8 /awstatsicons/os/unknown.png

8 /awstatsicons/os/unix.png

8 /awstatsicons/os/symbian.png

8 /awstatsicons/os/psp.png

#查看最近访问量最高的页面(.png)

#cat access_log |awk '{print $7}'|grep '.png'|sort|uniq -c|sort -nr |head -n 10

241 /awstatsicons/other/awstats_logo6.png

227 /awstatsicons/clock/hr12.png

226 /awstatsicons/other/vv.png

226 /awstatsicons/other/vu.png

226 /awstatsicons/other/vp.png

226 /awstatsicons/other/vk.png

226 /awstatsicons/other/vh.png

226 /awstatsicons/clock/hr9.png

226 /awstatsicons/clock/hr8.png

226 /awstatsicons/clock/hr7.png

#查看日志中访问超过100次的页面

#cat access_log | cut -d ' ' -f 7 | sort |uniq -c | awk '{if ($1 > 100) print $0}' | less

20107 /

1027 *

215 /awstatsicons/browser/chrome.png

215 /awstatsicons/browser/firefox.png

136 /awstatsicons/browser/mozilla.png

216 /awstatsicons/browser/msie.png

201 /awstatsicons/browser/netscape.png

123 /awstatsicons/browser/notavailable.png

214 /awstatsicons/browser/opera.png

215 /awstatsicons/browser/pdaphone.png

214 /awstatsicons/browser/safari.png

215 /awstatsicons/browser/unknown.png

226 /awstatsicons/clock/hr10.png

226 /awstatsicons/clock/hr11.png

227 /awstatsicons/clock/hr12.png

225 /awstatsicons/clock/hr1.png

226 /awstatsicons/clock/hr2.png

226 /awstatsicons/clock/hr3.png

226 /awstatsicons/clock/hr4.png

226 /awstatsicons/clock/hr5.png

226 /awstatsicons/clock/hr6.png

226 /awstatsicons/clock/hr7.png

226 /awstatsicons/clock/hr8.png

#access_log昨天一天的点击量(clicks);

cat access_log|grep '12/Nov/2009'|grep "******.jsp"|wc|awk '{print $1}'|uniq

0

#昨天访问网站的独立IP有多少;

cat access_log|grep '12/Aug/2009'|grep "******"|wc|awk '{print $1}'|uniq

194

#统计某url,一天的访问次数

#cat access_log|grep '12/Aug/2009'|grep '/images/index/e1.gif'|wc|awk '{print $1}'

2

#拉出前五天的访问次数最多的网页前20名清单;进行五天日志对比,找出排名靠前重复的网页,即可得出本周访问量最大的前几个网页;

#cat access_log|awk '{print $7}'|uniq -c |sort -n -r|head -20

10519 /

654 /manager/html

450 /manager/html

397 /

368 /manager/html

304 /

280 /manager/html

279 /

263 /manager/html

252 /manager/html

252 /manager/html

226 /

220 /

193 /

187 /

180 /

167 /

166 /

134 /

129 /

#从日志里查看该ip在干嘛:

#cat access_log | grep 218.66.36.119| awk '{print $1"\t"$7}' | sort | uniq -c | sort -nr | less

243 218.66.36.119 /

210 218.66.36.119 /awstatsicons/other/awstats_logo6.png

198 218.66.36.119 /awstatsicons/clock/hr12.png

197 218.66.36.119 /awstatsicons/other/vv.png

197 218.66.36.119 /awstatsicons/other/vu.png

197 218.66.36.119 /awstatsicons/other/vp.png

197 218.66.36.119 /awstatsicons/other/vk.png

197 218.66.36.119 /awstatsicons/other/vh.png

197 218.66.36.119 /awstatsicons/clock/hr9.png

197 218.66.36.119 /awstatsicons/clock/hr8.png

197 218.66.36.119 /awstatsicons/clock/hr7.png

197 218.66.36.119 /awstatsicons/clock/hr6.png

197 218.66.36.119 /awstatsicons/clock/hr5.png

197 218.66.36.119 /awstatsicons/clock/hr4.png

197 218.66.36.119 /awstatsicons/clock/hr3.png

197 218.66.36.119 /awstatsicons/clock/hr2.png

197 218.66.36.119 /awstatsicons/clock/hr1.png

197 218.66.36.119 /awstatsicons/clock/hr11.png

#列出传输时间超过 30 秒的文件

#cat access_log|awk ‘($NF > 30){print $7}’|sort -n|uniq -c|sort -nr|head -20

14058 /server-status?auto

8966 /

3955 /manager/html

1025 *

214 /www.766.com/awstats.www.766.com.html

211 /awstatsicons/other/awstats_logo6.png

199 /awstatsicons/clock/hr12.png

198 /awstatsicons/other/vv.png

198 /awstatsicons/other/vu.png

198 /awstatsicons/other/vp.png

198 /awstatsicons/other/vk.png

198 /awstatsicons/other/vh.png

198 /awstatsicons/clock/hr9.png

198 /awstatsicons/clock/hr8.png

198 /awstatsicons/clock/hr7.png

198 /awstatsicons/clock/hr6.png

198 /awstatsicons/clock/hr5.png

198 /awstatsicons/clock/hr4.png

198 /awstatsicons/clock/hr3.png

198 /awstatsicons/clock/hr2.png

#列出最最耗时的页面(超过60秒的)的以及对应页面发生次数

#cat access_log |awk ‘($NF > 60 && $7~/\.php/){print $7}’|sort -n|uniq -c|sort -nr|head -100

posted on 2012-06-25 14:34 wnguh 阅读(...) 评论(...) 编辑 收藏

转载于:https://www.cnblogs.com/591wed/archive/2012/06/25/2561226.html

Apache的Access.log分析总结相关推荐

  1. netstat--查看服务器[有效]连接数--统计端口并发数--access.log分析

    简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多播成员 (Multicast Member ...

  2. linux配置apache文件大小,linux下限制Apache日志access.log以及error.log文件大小

    如果网站开启了apache日志文件以及错误日志功能,那么很可能apache日志文件access.log在一段时间内就会很庞大至上百兆甚至几十个G,尤其大访问量的网站更是如此.error_log错误日志 ...

  3. 限制Apache日志access.log、error.log文件大小

    在 Windows 下的设置例子如下:  # 限制错误日志文件为 1M  ErrorLog "|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 1 ...

  4. 清除error.log、access.log并限制Apache日志文件大小的方法

    清除error.log.access.log并限制Apache日志文件大小的方法 Apache下的access.log和error.log文件从安装服务器到现在没有动过,今天突然discuz 的MYS ...

  5. ​清除error.log、access.log并限制Apache日志文件大小的方法

    有个客户反映vps网站打不开,登录系统检查下,客户是win2003系统,发现放置网站文件的D盘已被占满,可用空间为0KB,进去发现客户Apache服务器的错误日志error.log非常的大,造成D盘被 ...

  6. 【LTE】Qualcomm LTE Packets log 分析(一)LTE Access Stratum Log Analysis 1_PSS 2_RACH

    涉及的Packets: 1. PSS主同步信号数据捕获 (Initial Acquisition) [0xB113][LL1] LTE LL1 PSS Results : 主同步信号结果,返回周围小区 ...

  7. 【LTE】Qualcomm LTE Packets log 分析(三)LTE Access Stratum Log Analysis

    LTE Access Stratum Log Analysis 1. PSS主同步信号数据捕获 (Initial Acquisition) 2. 随机接入信道过程 (RACH Procedure) 前 ...

  8. Nginx的access.log日志分析工具-goaccess

    一.安装goaccess wget http://tar.goaccess.io/goaccess-1.3.tar.gz  --no-check-certificate #下载tar包 tar -xz ...

  9. Nginx 0.8.5版本access.log日志分析shell命令

    Nginx 版本信息:nginx version: nginx/0.8.53Nginx日志配置项:access_log /data0/logs/access.log combined;Nginx日志格 ...

最新文章

  1. 联手IBM布局云计算,王健林如何再造一个新万达?
  2. 用python画爱心-python画一个玫瑰和一个爱心
  3. NOIP2018 退役记
  4. 使用std::cout不能输出显示
  5. php Spreadsheet 导出,PhpSpreadsheet 导出Excel
  6. 加速进军自动驾驶领域,福特计划推出自动驾驶出租车服务
  7. python按指定条件筛选_求Python筛选数字集合内满足指定条件的数据方法,python筛选,唯一匹配是指mdash...
  8. 手机下载Python_将安卓手机打造成 Python 全栈开发利器
  9. js检查数据类型的方法
  10. ActiveMQ 即时通讯服务 浅析
  11. [论文阅读] Nearest Neighbor Classifier Embedded Network for Active Learning
  12. String基本操作
  13. 新手入门学Python一定要知道的编程开发工具
  14. 【SpringBoot】38 个常用注解
  15. postgrepsql 安装失败
  16. 普通视图和物化视图的区别(转)
  17. 银河麒麟使用时遇到的问题
  18. 精美底部营销通用型插件(客服+电话+微信)按钮
  19. vivo平台化实践探索之旅-平台产品系列01
  20. 服务器定位cpu高占用率代码php,面试官:线上服务器CPU占用率高如何排查定位问题?,...

热门文章

  1. .Net Core中Dapper的使用详解
  2. Python 用pygame模块播放MP3
  3. Good Time 冲刺 六
  4. [THINKING IN JAVA]访问权限控制
  5. NXOpen.BlockStyler的一些用法
  6. 什么是数字孪生体?来自西门子、PTC、北航的精华观点和实践
  7. uboot启动第一阶段——start.S
  8. pc css框架,PC端框架—semantic ui
  9. c# xls 复制一行_C# 复制Excel单元格格式
  10. 突发!联想被责令立即开展全面整改