Giter Site home page Giter Site logo

jomonjohnn / logan Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 149 KB

Just another regex based parallel log analyzer/parser with Boost.Asio and JSON output support

License: Mozilla Public License 2.0

CMake 1.29% C++ 98.71% C 0.01%
logparsing regex queue asio json cpp11 cmake logan boost log-analyzer parallel

logan's Introduction

License: MIT

logan

Just another Log Analyzer/parser. Tired of analyzing large log files with regex on sublime and Logan was born as a quick hack.

logan will match lines from an input file based on the regex provided via a rule file. The matching lines can be written to stdout or the same can be saved as a json file based on the capturte groups in the regex.

Design

Initial plan was to supply the input line while posting to io service, later found that its a bad idea, hence a fixed size queue is utlized to feed the lines to multiple consumers. The current operation is as follows,

  • Open rule file and load regex
  • Open input file, get a line and add to queue
  • asio will do the processing parallely

Building

Use camke to build logan,

git clone https://github.com/jomonjohnn/logan.git
mkdir loganbuild && cd loganbuild
cmake -DCMAKE_BUILD_TYPE=Release ../logan

Tested on Ubuntu 18.04 with g++ 7.3.0 and Boost 1.65.1

Usage

Invoke loagan with a input file and rule file

./logan -i <input file> -r <json rule file> -o <output json file>

Providing -w switch will write matching lines to stdout, hence by default all debug prints are redirected to stderr.

./logan -i <input file> -r <json rule file> -o <output json file> -w > out.txt

Authors

  • Jomon John < mail [at] jomon [dot] in>

Contributing

Any suggestions/improvemts/pull requests are welcome.

License

MPL 2.0

Dependencies

logan's People

Contributors

jomonjohnn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.