Skip to content

DanTaiko/log_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log_parser

Heavy metal log parser is my try to write a ruby script.

Version 0.1.5-a.1

The alpha-version is for demonstrating my programmer skills.

Task description

Write a ruby script that:

a. Receives a log as argument (webserver.log is provided) e.g.: ./parser.rb webserver.log

b. Returns the following:

  • list of webpages with most page views ordered from most pages views to less page views e.g.: /home 90 visits /index 80 visits etc...

  • list of webpages with most unique page views also ordered e.g.: /about/2 8 unique views /index 5 unique views etc...

Installation

  1. Clone the log_parser code

  2. Then, in the log_parser directory:

     $ bundle install

How to run app

Basic command:

 $ bin/parser analyze [PATH/TO/FILE]

Run HELP for the command delails

 $ bin/parser help

Commands:

parser help [COMMAND] # Describe available commands or one specific command

parser analyze [PATH/TO/FILE] # list the webpages with visits and then list the webpages with unique views

parser average_rating [PATH/TO/FILE] # list the resources with most views

parser resources_rating [PATH/TO/FILE] # list the resources with most views

parser webpages_rating [PATH/TO/FILE] # list the webpages with most page views

How to run specs

Run RSPEC in the log_parser directory

 $ rspec

Possible Improvements (ideas)

  1. Improve the user interface and CLI, especially the error handling.

  2. The Line class should be splitted into the LogLine and PrintLine classes.

  3. The specs could be made more readable.

  4. Make the app documentation.

About

Heavy metal log parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages