goaccess 支持强大的自定义log 格式,比如我们需要分析iis w3c 格式日志

参考iis w3c 字段

date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken

对应log format 定义

log-format %d %t %^ %m %U %q %^ %^ %h %u %s %^ %^ %T

参考格式说明

  • %x A date and time field matching the time-format and date-format variables. This is used when a timestamp is given instead of the date and time being in two separate variables.
  • %t time field matching the time-format variable.
  • %d date field matching the date-format variable.
  • %v The server name according to the canonical name setting (Server Blocks or Virtual Host).
  • %e This is the userid of the person requesting the document as determined by HTTP authentication.
  • %h host (the client IP address, either IPv4 or IPv6)
  • %r The request line from the client. This requires specific delimiters around the request (single quotes, double quotes, etc) to be parsable. Otherwise, use a combination of special format specifiers such as %m, %U, %q and %H to parse individual fields.
    Note: Use either %r to get the full request OR %m, %U, %q and %H to form your request, do not use both.
  • %m The request method.
  • %U The URL path requested.
    Note: If the query string is in %U, there is no need to use %q. However, if the URL path, does not include any query string, you may use %q and the query string will be appended to the request.
  • %q The query string.
  • %H The request protocol.
  • %s The status code that the server sends back to the client.
  • %b The size of the object returned to the client.
  • %R The "Referer" HTTP request header.
  • %u The user-agent HTTP request header.
  • %D The time taken to serve the request, in microseconds.
  • %T The time taken to serve the request, in seconds with milliseconds resolution.
  • %L The time taken to serve the request, in milliseconds as a decimal number.
  • %^ Ignore this field.
  • %~ Move forward through the log string until a non-space (!isspace) char is found.
  • ~h The host (the client IP address, either IPv4 or IPv6) in a X-Forwarded-For (XFF) field.

说明

demo 比较简单,实际可以参考自己的情况进行修改,同时结合log 的format 指南,我们可以方便的开发灵活的log 解析处理

参考资料

https://github.com/rongfengliang/goaccess-geoip-docker-compose-demo
https://goaccess.io/man#custom-log

 
 
 
 

goaccess iis w3c 自定义log 格式参考的更多相关文章

  1. OpenResty 自定义 access_log 格式

    定义access log的format是 Nginx已经提供的功能,有了 ngx_lua 之后就可以更灵活的记录请求相关的信息,而不仅仅拘泥于 Nginx的内置变量了,可以自定义一些格式和变量来存储结 ...

  2. IIS W3C日志记录字段和HTTP状态代码的说明

    像新网的部分服务器ftp目录有这个文件,但是就是提示没权限查看也没有权限下载,还得必须给他们打电话才能要到. 做为网站拥有者,我们应该关注IIS日志,从里面我们不仅仅可以看到网站的访问记录和搜索引擎的 ...

  3. 【教程】Tomcat 的catalina.out 日志按照自定义日期格式进行切割

    本文简单介绍在使用cronolog对tomcat的日志进行自定义日期格式的切割,方便日志的整理和遇到问题日志的排查! 安装cronolog 安装cronolog的方法网上有很多,这里也简单的介绍一下. ...

  4. ELK收集Nginx自定义日志格式输出

    1.ELK收集日志的有两种常用的方式: 1.1:不修改源日志格式,简单的说就是在logstash中转通过 grok方式进行过滤处理,将原始无规则的日志转换为规则日志(Logstash自定义日志格式) ...

  5. poi中如何自定义日期格式

    1. poi的“Quick Guide”中提供了 “How to create date cells ”例子来说明如何创建日期单元格,代码如下: HSSFCellStyle cellStyle = w ...

  6. [经验分享]SecureCRT导出操作日志 + Notepad自定义语言格式高亮日志文件

    起因及效果展示 最近使用CRT,有些命令会输出很多内容,这时如果你想要得知输出内容是从哪里开始的,很容易被大量的同种颜色的文字搞的晕头转向.如果输入的命令是不同的颜色,这会大大得帮助我们. 所谓的命令 ...

  7. git-定制属于你的log格式

    软件版本:    操作系统:ubuntu10.04     内核版本:Linux version 2.6.32-36-generic     git 版本:git version 1.7.0.4 1. ...

  8. Mui自定义时间格式:

    Mui自定义时间格式: (function($) { $.init(); $(document).on('tap','.btn',function(){ var obj = getFormJson($ ...

  9. MapReduce实战:自定义输入格式实现成绩管理

    1. 项目需求 我们取有一份学生五门课程的期末考试成绩数据,现在我们希望统计每个学生的总成绩和平均成绩. 样本数据如下所示,每行数据的数据格式为:学号.姓名.语文成绩.数学成绩.英语成绩.物理成绩.化 ...

随机推荐

  1. 【转载】Selenium WebDriver的简单操作说明

    转载自:http://blog.csdn.net/xiao190128/article/details/49784121 1.打开一个测试浏览器 对浏览器进行操作首先需要打开一个浏览器,接下来才能对浏 ...

  2. [原]JSBSim 自动驾驶(浅出)

    jsbsim的脚本文件分为几大类: 1.系统脚本: systems  包含通用飞机各部分功能模块组件以及自动飞行控件:Autopilot.xml  和 自动飞行的算法控件:GNCUtilities.x ...

  3. ActiveMQ组件使用方法

    由于组件使用了spring,故需要相关的spring包及配置 首先,需要加载对应的jar包 然后,编写调用类 package com.demo.testSpring; import com.jfina ...

  4. phpmyadmin-您可能正在上传很大的文件,请参考文档来寻找解决方法

    phpmyadmin-您可能正在上传很大的文件,请参考文档来寻找解决方法   实这个很简单的只要更改php.ini里三个配置即可.(见下面加粗部分,改成你自己的需求即可) ; Maximum allo ...

  5. python自动化测试入门篇-jemter连接mysql数据库

    jmeter对数据库的操作主要包括以下几个步骤:1.导入mysqlde jdbc的jar包:2.创建数据库连接配置:3.线程组添加jdbc request;4.启动按钮,添加查看结果树 一.准备好驱动 ...

  6. tensorflow world language model

    上文提到了pytorch里的world language model,那么怎么能不说tensorflow的实现呢,还是以tensorflow ptb的代码为例说说. 地址: https://githu ...

  7. 关于wincc与博图的安装问题

    博图软件支持西门子1500CPU,但是在step7中不支持. 关于博图与wincc的安装顺序,在很多人觉得是没有安装顺序的,最好的安装顺序是: 先安装wincc,再安装博图 细节问题: 在安装博图时, ...

  8. TreeTagger

    大家都知道TreeTagger是一个用于词性标注和词型还原的工具,它的返回结果由三部分组成:目标词汇,词性,原形.那该工具是怎样判断目标词汇的词性的呢?又是怎样得到目标词汇的原形的呢?本文就是从这两个 ...

  9. 从零开始学Shell(二)

    $1,$2....${10},${11},[root@localhost cee]# cat p.sh #!/bin/bash#file_name:p.shecho $1 $2[root@localh ...

  10. php优秀框架codeigniter学习系列——CI_Security类学习

    这篇文章主要介绍CI核心框架工具类CI_Security. 安全类包含了一些方法,用于安全的处理输入数据,帮助你创建一个安全的应用.以下选取类中的重点方法进行说明. __construct() 在构造 ...