GithubHelp home page GithubHelp logo

udacity-log-analysis's Introduction

Log Analysis Project

Python / PostgresSQL project to print the answers to 3 questions to the terminal:

  1. What are the most popular three articles of all time?
  2. Who are the most popular article authors of all time?
  3. On which days did more than 1% of requests lead to errors?

Requirements

  • Python 3.x.x

Installation / Execution

This program utilises 3 PSQL views. They are created at runtime and DO NOT need to be created before running the program.

However, if for some reason they cannot be created at runtime, please refer to the 3 queries below:

create or replace view log_404 as
select time::date as date, count(id) as error_count
from log
where status = '404 NOT FOUND'
group by date;
create or replace view log_grouped as
select time::date as date, count(id) as response_count
from log
group by date;
create or replace view log_error_summary as
select l1.date, l1.error_count, l2.response_count,
round((cast(l1.error_count as decimal) / l2.response_count) * 100, 1) as percentage_errors
from log_404 l1
join log_grouped l2 on l1.date = l2.date;

Run the program from project root as follows:

python3 main.py

udacity-log-analysis's People

Contributors

hjmsw avatar

Watchers

 avatar  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.