Skip to content

This is my Logs Analysis project for Udacity's Full Stack Developer Nanodegree.

Notifications You must be signed in to change notification settings

ptya/logs-analysis-project-udacity-fsnd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Logs Analysis Udacity Project ⭐

This is my Logs Analysis project for Udacity's Full Stack Developer Nanodegree.

It is a Python script using psycopg2 to run queries on a mock PostgreSQL database for a fictional news website.

It generates a console output for three reports:

  1. Top 3 articles, most viewed first.
  2. Most popular authors, most viewed first.
  3. Days above 1% request errors

Mock database structure

Table "authors"

Column Type
name text
bio text
id integer

Primary key:

  • id

Table "articles"

Column Type
author integer
title text
slug text
lead text
body text
time timestamp with time zone
id integer

Primary key:

  • id

Foreign-key:

  • author REFERENCES authors(id)

Table "log"

Column Type
path text
ip inet
method text
status text
time timestamp with time zone
id integer

Primary key:

  • id

Installation ☕

Prerequisites: 🎮

Environment setup 💥

  1. Unzup and copy the newsdata.sql file from newsdata.zip to your vagrant directory
  2. Start the VM using your console in the downloaded Vagrant VM's directory using vagrant up
  3. SSH into your VM using vagrant ssh
  4. To load the data, cd into the vagrant directory and use the command psql -d news -f newsdata.sql

Application setup 👋

  1. Create a new directory in vagrant's shared directory (i.e.: ../vagrant/logs_analysis/)
  2. Clone the repository and put it into the previously created directory. (i.e.: ../vagrant/logs_analysis/)

Usage 💻

  1. SSH into your VM using vagrant ssh
  2. cd into the created folder (i.e.: /vagrant/logs_analysis)
  3. Run ./reporting.py

An example of the output can be seen in output_example.txt

License :trollface:

Copyright (c) 2017 Péter Szabó. All rights reserved.

This work is licensed under the terms of the MIT license.
For a copy, see https://opensource.org/licenses/MIT.

About

This is my Logs Analysis project for Udacity's Full Stack Developer Nanodegree.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages