Git Product home page Git Product logo

apache-log-parser's Introduction

Apache Log Parser - UBS

Apache Log Parser

Compile Instruction

  • Requirements: golang 1.8
  • Execute Test: make test
  • Execute Test & Build: make build
  • Execute Test, Build, & Run: make run

$GOPATH is set in the Makefile, Tested environment: Linux Fedora 25

Structure

  • src/def: contain classes definition for Logs
  • src/scanner: Scan log string to parser
    • src/scanner/file: File scanner
  • src/parser: Parser for string to ApacheLog struct
  • bin/: Output of binary file, bin/apache_test also copied to root directory

Binary execution

  • ./apache_test [file_name] [is_exit_of_fail]
    • file_name: Log file to be processed, default: example.txt
    • is_exit_of_fail: Should test exit if one test Fail, default: true, accept: true, false, 0, 1, T, F
    • Example: ./apache_test example.txt false

Assumption

  • UserID (%u) and UserIdent (%l) doesn't contain spaces
  • Logs is already sorted by date ascending
  • In case logs unable to be parsed, it will be ignored
  • In case POST doesn't find PUT before the logs, test 3. PUT before POST will Fail
  • For test 4. Suspicious activity, The log must have less than five 401 responses from any host assumed as Log must have less than five 401 responses from each Remote Hosts
  • Input log is a file, not stdin
  • By default, script will return Exit(2) if one of the test fail, to continue without exiting, please set is_exit_of_fail to False

Reference Links

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.