Giter VIP home page Giter VIP logo

parser's Introduction

parser

file parser and analyser

The project load and parse a .txt file with a configurable argument delimiter, put all the parsed data in a MySql database and analyse data with some business rules.

Project need a localhost MySql data base you can use docker compose to build and run the environment.

cd src/main/docker
docker-compose build
docker-compose run

With a correctly environment run with:

java -jar parser-0.0.1.jar --accesslog=path/to/file --startDate=2017-01-01.00:00:00 --duration=daily --threshold=200

arguments

  • bulk_insert.batch_size: (optional, default: 20) The batch size used in the bulk insert flush clear.

  • separatorRegex: (optional, default: \|) Regex to parser file.

  • accesslog: path to file, need to pass only the root path that contains the file example: accesslog=/tmp

  • filename: (optional, default: access.log) The file name with extension

  • startDate: start date to use as a filter.

  • duration: can take only "hourly", "daily"

  • threshold: delimiter parameter to use as a filter.

  • datePattern: (optional, default: yyyy-MM-dd HH:mm:ss) date pattern to parse string as date.

Useful Queries

select ip, count(*) total from wallethub_logs
where date between '2017-01-01.15:00:00' and '2017-01-01.15:59:59'
group by ip
having count(*) >= 200;
select * from wallethub_logs where ip = '192.168.234.82';
select * from blocked_ips;

parser's People

Contributors

rodrigoords avatar

Watchers

 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.