/log_analysis

Full Stack UdacityND Project

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

log_analysis

Full Stack UdacityND Project

Version Build Lang DB Dependancies Dependancies


Contents


About

This is an assignment project for Udacity Full Stack Nanodegree Log analysis project

This repo is only for educational purposes

Dependancies

database

Python

  • either 2.x or 3.x is tested and running well

  • python modules that the original script runs on:

    Module version
    psycopg2 2.8.3 +
    tabulate 0.8.5 +

    previous versions should work but it's not tested

    if any not installed just install them with pip [python 2.x]

    sudo pip install -r requirements.txt

    pip3 [python 3.x]

    sudo pip3 install -r requirements.txt

    or the script will ask you to install them for you this will need root previllages on Unix/Linux systems, so just run the script like

    '''bash sudo ./log_analysis.py '''

    [Note]:

    The script it self doesn't work with root previllages, This is just for installing dependances

    You could have a look on the official pip install for just

Usage

Be sure the tese files are listed in your working directory

  • log_analysis.py
  • gvar.py

python2

python log_analysis.py

python3

python3 log_analysis.py

Or you could make it executable with the command

chmod +x log_analysis.py

then run it with python3

./log_analysis.py

Usage example

$ ./log_analysis.py

Most popular three articles of all time: 
  Views  Article
-------  --------------------------------
 338647  Candidate is jerk, alleges rival
 253801  Bears love berries, alleges bear
 170098  Bad things gone, say good people

Most popular article authors of all time: 
  Views  Author
-------  ----------------------
 507594  Ursula La Multa
 423457  Rudolf von Treppenwitz
 170098  Anonymous Contributor
  84557  Markoff Chaney

On which days did more than 1% of requests lead to errors: 
   %  Date
----  ------------
2.26  Jul 17, 2016

Highlights

Features

  • Logs are printed as tables
  • tables is printed colored in terminal
  • self install requirements.txt

TO DO

  • improve cli version
    • interactive playground
    • only get specific logs
    • Make use of system arguments
  • add web version

Contributing

Contributors

Pull requests and stars are always welcome. For bugs and feature requests, Kindly create an issue.

Author

Abdelaziz Sharaf

License

Copyright © 2017, Abdelaziz Sharaf under the GPL License.