Skip to content

Latest commit

 

History

History
executable file
·
56 lines (38 loc) · 1.99 KB

README.md

File metadata and controls

executable file
·
56 lines (38 loc) · 1.99 KB

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