Giter VIP home page Giter VIP logo

web-log-parser's Introduction

web-log-parser

web-log-parser is an open source analysis web log tool, developed in python language, with flexible log format configuration

中文说明文档


Example

example picture


Instructions

  1. store the logs files in the data directory ./data
  2. modify config.ini
  3. install requirements pip install -r requirements.txt
  4. start the analysis in bin dircd ./bin && python start.py
  5. check html result in result dir result/index.html

Configuration

Format

  • log-pattern: regular expression for parsing logs
  • log-format: log content format, corresponding log-pattern match. The following configuration items are supported by default.:
    • ip: request IP
    • real_ip: user real IP. If this option is configured, ip configuration will be ignored, and real_ip will be used for statistics.
    • datetime: request access time
    • url: request url
    • method: request method
    • protocol: request protocol
    • cost: request cost

Filter

  • support_method: supported request method, otherwise no statistics
  • is_with_parameters: enable flag for statistics url parameter,By default, the parameters in the URL will be converted, such as? Key = 123 when converting to key = {key}
  • urls_most_number: the maximum number of URLs separately counted
  • custom_parameters: configure special parameter key-value pairs, separated by commas, when configured t = {timeStamp}, the value of t key will be replaced with a fixed {timeStamp}
  • fixed_parameter_keys: configure special parameter key values, separated by commas, when configured key = 123, will not be replaced with key = {key}
  • ignore_urls: urls will be ignore
  • static-file: file suffixes will be ignore

Report

  • language: the language use in the report
    • chinese
    • english
  • second_line_flag: enable flags for PV curve graph per second
  • cost_time_flag: enable flags for response time interval proportion map and response time distribution map

GoAccess

  • goaccess_flag: whether to get GoAccess analysis results, set to 1: Get, 0: Do not get (requires GoAccess installed)
  • time-format: time format, for GoAccess
  • date-format: date format, for GoAccess
  • goaccess-log-format: log format,for GoAccess

web-log-parser's People

Contributors

jeffxue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-log-parser's Issues

运行报错

2022-06-08 14:07:15.899174 Start parse file : access_http.log
Traceback (most recent call last):
File "/opt/log_analyse/web-log-parser-master/bin/start.py", line 381, in main
parse_log_file(target_file, log_format)
File "/opt/log_analyse/web-log-parser-master/bin/start.py", line 232, in parse_log_file
response_avg = int(pv / len(set(times)))
ZeroDivisionError: division by zero

encoding

C:\Users\Shane\source\repos\web-log-parser\bin>python start.py
Traceback (most recent call last):
File "start.py", line 12, in
from config import config
File "C:\Users\Shane\source\repos\web-log-parser\bin\config.py", line 54, in
config = Config('../conf/config.ini')
File "C:\Users\Shane\source\repos\web-log-parser\bin\config.py", line 11, in init
all_config.readfp(cfg_file)
File "C:\Python38\lib\configparser.py", line 763, in readfp
self.read_file(fp, source=filename)
File "C:\Python38\lib\configparser.py", line 718, in read_file
self._read(f, source)
File "C:\Python38\lib\configparser.py", line 1017, in _read
for lineno, line in enumerate(fp, start=1):
File "C:\Python38\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 493: character maps to

尝试分析nginx日志遇到错误

大神您好,尝试使用您的日志分析器,把access.log放到data下运行 python start.py遇到下列错误
[root@localhost bin]# python start.py
2021-04-30 15:59:00.200930 Start parse file : access.log
Traceback (most recent call last):
File "/home/web-log-parser-master/bin/start.py", line 381, in main
parse_log_file(target_file, log_format)
File "/home/web-log-parser-master/bin/start.py", line 232, in parse_log_file
response_avg = int(pv / len(set(times)))
ZeroDivisionError: division by zero

问一下是哪里没有设置呢?谢谢您。

某些URL解析出现问题

245 /app/index.jsp&client=weixin&deviceId=&userId=&companyName=%E6%98%93%E8%AE%A2%E8%B4%A7 GET HTTP/1.0

253 /app/index.jsp?client={client}&companyName={companyName} GET &from=groupmessage&isappinstalled=0

254 /app/index.jsp?client={client}&companyName={companyName} GET +
255 /app/index.jsp?client={client}&companyName={companyName} GET [

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.