tomcat日志格式  在配置文件 server.xml 中,具体参照官方文档 https://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Access_Log_Valve

pattern

A formatting layout identifying the various information fields from the request and response to be logged, or the word common or combined to select a standard format. See below for more information on configuring this attribute.

  • %a - Remote IP address 远端IP
  • %A - Local IP address 本地IP
  • %b - Bytes sent, excluding HTTP headers, or '-' if zero 发送字节数
  • %B - Bytes sent, excluding HTTP headers 发送字节数
  • %h - Remote host name (or IP address if enableLookups for the connector is false) 远端主机名
  • %H - Request protocol 请求协议
  • %l - Remote logical username from identd (always returns '-')  远端逻辑用户名
  • %m - Request method (GET, POST, etc.) 请求类型
  • %p - Local port on which this request was received. See also %{xxx}p below. 请求端口
  • %q - Query string (prepended with a '?' if it exists) 查询字符串
  • %r - First line of the request (method and request URI)  请求字符串(方法 & 请求URL)
  • %s - HTTP status code of the response  返回码
  • %S - User session ID
  • %t - Date and time, in Common Log Format  日期
  • %u - Remote user that was authenticated (if any), else '-'
  • %U - Requested URL path
  • %v - Local server name
  • %D - Time taken to process the request, in millis
  • %T - Time taken to process the request, in seconds
  • %F - Time taken to commit the response, in millis
  • %I - Current request thread name (can compare later with stacktraces)

根据日志格式,统计请求 返回码(200, 500,404 等)

提取返回码命令  :

grep ${TODAY} ${LogAccess} | grep -v "GET / HTTP/1.1" | awk '{print $11}' | wc -l

192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:17 +0800] "GET /CloudNetMonitor/src/app/business/netMonitor/theme/custom/img/mask-loading.gif HTTP/1.1" 200 5093 6
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:17 +0800] "POST /CloudNetMonitor/rest/v1/netmonitor/web/smallFlow HTTP/1.1" 200 403 42
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:17 +0800] "POST /CloudNetMonitor/rest/v1/netmonitor/web/probe/heartBeat/query HTTP/1.1" 200 2055 59
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:18 +0800] "GET /CloudNetMonitor/src/app/business/netMonitor/src/overview/views/currentAlarm.html HTTP/1.1" 200 14350 5
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:18 +0800] "GET /CloudNetMonitor/src/app/business/netMonitor/src/overview/controllers/currentAlarmCtrl.js HTTP/1.1" 200 12739 7
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:18 +0800] "GET /CloudNetMonitor/src/app/business/netMonitor/src/overview/services/alarmService.js HTTP/1.1" 200 5005 4
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:18 +0800] "GET /CloudNetMonitor/src/app/business/netMonitor/src/overview/controllers/ruleHideCtrl.js HTTP/1.1" 200 2890 4
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:18 +0800] "POST /CloudNetMonitor/rest/v1/netmonitor/web/syslogAlarmSend/query/activity HTTP/1.1" 200 3337 46
192.145.17.126 10.177.68.157 10.177.68.157 - - [24/Aug/2018:16:48:18 +0800] "GET /CloudNetMonitor/src/app/business/netMonitor/theme/image/major.png HTTP/1.1" 200 1325 4

用定时脚本 每天23:59分 即可统计请求数量

统计web 访问日志的请求数据的更多相关文章

  1. 机器数据的价值 - Web 访问日志和数据库审计日志

    计算机数据 大量的数据流,不断增长的来源,蕴含着巨大的价值 在 Splunk,我们大量谈及计算机数据.这些数据是指在数据中心.“物联网”和互联设备世界中运行的所有系统产生的数据.其中包括支撑组织的应用 ...

  2. 可视化分析 web 访问日志

    内容目录 Python 基础 使用模块介绍 可视化组件 echarts 介绍 Web 访问日志 代码解读 讲师:KK 多语言混搭开发工程师,多年 PHP.Python 项目开发经验,曾就职 360.绿 ...

  3. Python开发程序:生产环境下实时统计网站访问日志信息

    日志实时分析系统 生产环境下有需求:要每搁五分钟统计下这段时间内的网站访问量.UV.独立IP等信息,用直观的数据表格表现出来 环境描述: 网站为Nginx服务,系统每日凌晨会对日志进行分割,拷贝到其他 ...

  4. Python开发【项目】:生产环境下实时统计网站访问日志信息

    日志实时分析系统 生产环境下有需求:要每搁五分钟统计下这段时间内的网站访问量.UV.独立IP等信息,用直观的数据表格表现出来 环境描述: 网站为Nginx服务,系统每日凌晨会对日志进行分割,拷贝到其他 ...

  5. Centos下Nginx配置WEB访问日志并结合shell脚本定时切割

    在一个成熟的WEB系统里,没有日志管理是不可以的,有了日志,可以帮助你得到用户地域来源.跳转来源.使用终端.某个URL访问量等相关信息:通过错误日志,你可以得到系统某个服务或server的性能瓶颈等. ...

  6. Tomcat配置自定义访问日志 --- 获取请求头部信息

    使用tomcat,搭建完个人网站后,默认记录来访游客的信息是十分有限的,主要有ip和路径以及方法等. 有时候为了获取更多来访信息,比如请求的头部信息,这个时候就需要我们手动配置log了. 开始 进入T ...

  7. 通过Nginx,Tomcat访问日志(access log)记录请求耗时

    一.Nginx通过$upstream_response_time $request_time统计请求和后台服务响应时间 nginx.conf使用配置方式: log_format main '$remo ...

  8. 使用 awstats 分析 Nginx 的访问日志(IBM)

    前言 在我的上一篇文章<使用 Nginx 提升网站访问速度>中介绍了 Nginx 这个 HTTP 服务器以及如何通过它来加速网站的访问速度.在实际的网站运营中,我们经常需要了解到网站的访问 ...

  9. 配置nginx,Tomcat日志记录请求耗时

    由于公司的业务比较特殊,对速度比较在意,客户最近反应我们的平台时间比较久,处理一个请求十秒左右才返回,领导要求找出原因,我想让nginx日志记录请求处理用了多长时间,后端处理用了多长时间,总共用了多长 ...

随机推荐

  1. C语言中可变参数的原理——printf()函数

    函数原型: int printf(const char *format[,argument]...) 返 回 值: 成功则返回实际输出的字符数,失败返回-1. 函数说明: 使用过C语言的人所再熟悉不过 ...

  2. Redis混合存储-冷热数据识别与交换

    Redis混合存储产品是阿里云自主研发的完全兼容Redis协议和特性的混合存储产品. 通过将部分冷数据存储到磁盘,在保证绝大部分访问性能不下降的基础上,大大降低了用户成本并突破了内存对Redis单实例 ...

  3. js排序专场

    1,冒泡排序 function bubble(arr) { var len = arr.length - 1; for (let i = 0 ; i < len; i++) { var bool ...

  4. BZOJ 2744

    #include<iostream> #include<cstdio> #include<cstring> #include<vector> #incl ...

  5. 123-PHP类构造函数

    <?php class ren{ //定义人类 private $name; //定义成员属性 public function __construct($name){ //定义构造函数 $thi ...

  6. linux项目,项目报错,排查

    今天在遇到以前部署的项目突然没有数据了,然后就去服务器看了一下,打印日志发现报错了,现在我是一脸懵逼,因为不知道怎么排查 然后同事告诉说先看报错的原因,然后再去找认识的类,我打码的都是一些认识的 然后 ...

  7. weex 随笔

    1.三大模块: <template>:样板,内容区 <style>:css <script>: js <script> export default{ ...

  8. Swift之分割视图控制器-UISplitViewController

    Swift之分割视图控制器-UISplitViewController UISplitViewController这种控制器只能用于iPad,它可以在iPad屏幕中显示两个不同的场景:在横向模式下,左 ...

  9. 干货分享:Essay写作收集论据的三个方法

    在很多时候,中国留学生写出的Essay在西方学术界看来是存在plagiarism的情况.并不是说咱们写的所有东西都是抄袭,而是思维逻辑和利用证据的方式与西方权威的academic writing不同. ...

  10. LIS是什么?【通讯】

    Ⅲ最后一点,通讯. 从字面意义来看,通讯是一种沟通形式,信息交互的媒介.在LIS中,通讯主要指的是仪器通讯,也就是仪器与电脑-LIS系统的信息交互方式,也可以称为仪器接口. 在LIS中,通讯是最基础也 ...