Giter VIP home page Giter VIP logo

pml's Introduction

pml - parse my log

Parse a nginx log file and display statistics

Requirements

Run

./pml.lisp [--logfile FILE] [--format FORMAT] [METRICS] [FILTERS]

Supported metrics

  • --ip : group by remote address
  • --path: group by HTTP request path
  • --verb: group by HTTP verb
  • --status: group by HTTP status code
  • --agent: group by user agent

Supported output formats

  • json
  • csv
  • txt (default)

Supported filters

  • start : a start date
  • end : an end date

TODO

  • System definition
  • Configurable log format

Sample output

$> ./pml.lisp --logfile sample/big.log --format txt --verb --status --ip --path --start "2017-01-01" --end "2017-02-15"

 * By verb
GET     916     91.6%
POST	84      8.4%

 * By status
200     562     56.2%
304     304     30.4%
404     101     10.1%
302     33      3.3%

 * By remote address
10.1.2.3	603     60.3%
10.1.2.4	310     31.0%
10.1.2.5	60      6.0%
10.1.2.6	27      2.7%

 * By path

/               31      3.1%
/products       31      3.1%
/products/25	31      3.1%
/products/2     30      3.0%
/about          30      3.0%
/contact        30      3.0%
/categories/36	30	    3.0%
/products/16	30	    3.0%
/categories/11	29	    2.9%
/products/48	29	    2.9%
/categories/85	29	    2.9%
/categories/45	29	    2.9%
/tags           29	    2.9%
/tags/7         19	    1.9%
/tags/14        17	    1.7%

[... skip ...]

License

pml is released under the MIT License.

pml's People

Contributors

pierre-lecocq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cneira

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.