Giter Club home page Giter Club logo

logorator's Introduction

logorator

A log grinder to extract statistics and more

What it does

  1. A backend python log grinder to analyze, extract and compute information, generating JSON files with different content like:
  • a distinct list of URLs with a count visit number taken from the log files. See the algorithm here
  • a distinct list of URLs with the count visit number taking the list from a given URLs router map file and counting the occurrencies of those URLs within the log files. See the algorithm here
  • a from-to pattern pair of urls starting from the log files, extracting relevant URLs grouped by the same user/ip, and counting the occurrencies of each from-to pattern. See the algorithm here
  1. A web dashboard to view results from the backend analysis with some filtering options

How to use

Get the source project

git clone [email protected]:ncounter/logorator.git
cd logorator

Configuration

You may want to configure parameters in the logorator.conf file first.

...
tomcat_log_path=<TOMCAT_LOGS_PATH>
stats_file=./dashboard/public/stats.json
known_urls_output=./dashboard/public/known-urls.json
pattern_file=./dashboard/public/patterns.json
...

Important: changing location of files within this application, stats_file for instance, will make the dashboard web page unable to load data. Please make sure you will update the json source file name accordingly for each page.

Backend: python analyzer

Important

The count_urls.py program makes an assumption about your log format expecting log lines with the request information containing the url wrapped between "", something like the following:

192.168.1.101 - - [19/Oct/2017:11:00:16 +0200] "POST /my/url/path HTTP/1.1" 200 334

The known_urls.py relies on the output of count_urls.py and on the output it generates itself from a given .xml map files with

  <action-mappings>
    <action path=""></action>
  </action-mappings>

element tags for the list of known routes.

The elaborate_patterns.py relies on more than one assumption instead:

  • the ip address
  • the date and time format
  • the url

Running

Everything in one shot

cd logorator
python backend/logorator.py

*Note: in case you miss to populate some configuration parameter values, the related elaboration will not be executed"

Frontend: dashboard web page

Available pages:

  • Raw Stats - How many times your urls have been hitten?
  • Known route Stats - Which known routes have been hit the most, and which never?
  • Refined Patterns - Frequent patterns workflow

Requirements

  1. Nodejs
  2. Yarn

Running

cd logorator/dashboard
yarn install
yarn start

logorator's People

Contributors

ncounter avatar

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.