shrutisheoran / log-analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log Analysis

This project answers to the following questions using sql

  • Most popular articles of all time
  • Most popular authors of all time
  • Date on which more than 1% requests lead to errors

To know answers follow the instructions

Meeting the Requirements

  1. Configure virtual machine using vagrant
  • Download vagrant from here
  • Download configuration files from here
  • Extract those files in a folder then open git bash in the folder.
  • Run vagarant up in git bash.
  • Then run winpty vagrant ssh or vagrant ssh to login.
  • Now you have up and runnig postgresql in your system with python3 and newly created database news.
  1. Tables and necessary python libraries.
  • cd into vagrant by running cd /vagrant.
  • Run sudo apt-get install psycopg2 if not installed.
  • To create all the necessary tables download the newsdata.sql file from here.
  • Then run this command psql -d news -f newsdata.sql.

Run Log Analysis

  1. Clone or download the zip file of the repository.
  2. Extract the files in a folder.
  3. Open git bash in the folder.
  4. Now to obtain the analysis run python3 reporting_tool.py or .\reporting_tool.py.
  5. Open the following text files to see the output.
  • popular_articles.txt
  • popular_authors.txt
  • status.txt

About


Languages

Language:Python 100.0%