#查看80端口的tcp连接 



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







#当前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 







#昨天访问网站的独立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}' 







#拉出前五天的访问次数最多的网页前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

Apache的Access.log分析总结的更多相关文章

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

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

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

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

  3. PHP Apache Access Log 分析工具 拆分字段成CSV文件并插入Mysql数据库分析

    现在需要分析访问日志,怎么办? 比如分析D:\Servers\Apache2.2\logs\access2014-05-22.log http://my.oschina.net/cart/针对这个问题 ...

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

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

  5. [日志分析] Access Log 日志分析

    0x00.前言: 如何知道自己所在的公司或单位是否被入侵了?是没人来“黑”,还是因自身感知能力不足,暂时还没发现?入侵检测是每个安全运维人员都要面临的严峻挑战.安全无小事,一旦入侵成功,后果不堪设想. ...

  6. 关于apache access log 统计的那些事儿

    统计APACHE ACCESS.LOG IP访问记录 可以根据自己的需要,统计很多,每个IP访问多少个页面等等! cat access.log-20090904 |awk '{print $3}'|s ...

  7. goaccess分析access.log

    接上一篇,开始学习goaccess使用~ 源码安装完成后,我的goaccess的配置文件goaccess.conf位于/usr/local/etc/ /usr/local/etc/goaccess/g ...

  8. Tomcat access log配置

    在tomcat的access中打印出请求的情况可以帮助我们分析问题,通常比较关注的有访问IP.线程号.访问url.返回状态码.访问时间.持续时间. 在Spring boot中使用了内嵌的tomcat, ...

  9. springboot中配置tomcat的access log

    在tomcat的access中打印出请求的情况可以帮助我们分析问题,通常比较关注的有访问IP.线程号.访问url.返回状态码.访问时间.持续时间. 在Spring boot中使用了内嵌的tomcat, ...

随机推荐

  1. QT:“下载速度柱状图”的模拟实现——思路真好,会动脑筋,连我都有了启发(这个思路好像是通用的)

    不知是哪个版本的迅雷,有个“下载速度柱状图”的小界面,我比较喜欢(只不过最新版本的迅雷却没了),所以决定来山寨一个.当然,这个山寨品不能下载文件,呵呵. 思路:1:将界面的背景涂成黑色2:每隔0.1秒 ...

  2. C语言的本质(22)——C标准库之字符串操作

    编译器.浏览器.Office套件等程序的主要功能都是符号处理,符号处理功能在程序中占相当大的比例,无论多复杂的符号处理都是由各种基本的字符串操作组成的,下面介绍如何用C语言的库函数做字符串初始化.取长 ...

  3. Node.js log1: ERR can not find module express

    1.win7下创建项目中提示输入的命令:cd project&&npm install    安装失败 输入上面提示的命令,预期结果:自动安装了依赖 ejs 和 express,失败提 ...

  4. flex容器解析

    通常在Flex种有两种形式的容器:布局和导航. 在容器中我们可以同时设置一些空间和子容器,我们可以叫在容器内定义的任何组件为该容器的孩子. 在一个Flex程序的根部是一个叫做Application C ...

  5. Exception in thread "main" java.io.IOException: Failed to set permissions of path

    在跑BuildForest的时候,编写了下面的程序: package test.breiman; import org.apache.mahout.classifier.df.mapreduce.Bu ...

  6. User has no SELECT privilege on V$SESSION

         今天是2013-09-20,最近心情一直很差,但是也不能不学习啊,无论怎么样,自己学到 的东西永远都是自己的.加油! 使用dbms_xplan.display_cursor function ...

  7. 1、什么是Lucene,Lucene能干什么

    1.什么是lucene  Lucene是一个全文搜索框架,而不是应用产品.因此它并不像http://www.baidu.com/ 或者google Desktop那么拿来就能用,它只是提供了一种工具让 ...

  8. hdu 5199 Gunner(STL之map,水)

    Problem Description Long long ago, there is a gunner whose name is Jack. He likes to go hunting very ...

  9. 最新的Android SDK安装攻略(动作要快,来晚就失效了)

    Android的环境搭建好折腾,光是下载Android SDK就折腾了好几天, 直接连接,速度接近于0,一行行红色的refused, 然后找软件翻*墙成功(不推荐,软件可能有后门) 但是...速度比老 ...

  10. DoNet开源项目-基于Amaze UI的点餐系统

    帮朋友做的点餐系统,主要是为了让顾客在餐桌上,使用微信扫描二维码,就可以直接点菜,吃完使用微信付款. 系统演示地址,账户名和密码均为:admin.(请不要删除admin用户) GitHub Clone ...