Skip to content

deyanemo/Logs-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Logs-Analysis : a project for Full Stack developer nano degere for reporting logs stored into a database

Why we report anyway ? We report to get the summary from the logs , to get a more information about whats going on on our site , what type of errors or what type of articles that the visiters admires...etc

Requirements

Installation : this will not provide tips to install vagrant and virtualbox after starting the Vagrant and Virtualbox open cmd as administrator(*) and type : vagrant up ssh 127.0.0.1 2222 username : vagrant password : vagrant

after signing in :
- install PostgersSQl:            [ sudo apt-get install postgres ]
- Run psql and install db:        [ psql -d news -f newsdata.sql ]
Please Note before running the script please create the views in order to the program to run

For creating the author view to answer question 2:

        create or replace view mauthors as select author,count(log.path)
            as num from articles, log where articles.slug=
            substring(path from 10 for 100) group by author order
            by num DESC

For creatin error view answering question 3:

        create or replace view err as select to_char(time,'Mon DD, YYYY')
            as date , count(status) from log where status!='200 OK'
            group by date order by date ASC;

        create or replace view ok as select to_char(time,'Mon DD, YYYY')
            as date , count(status) from log
            group by date order by date ASC;

- Run Script using :              [python nemo.py]

Files: - database_setup.py * - nemo.py * - README.md

NOTE : Thank you

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages