- Python3
- Linux Machine (either VM or main)
- PostgreSQL db
Download sql zip file from newdata.zip into linux vm and perform following steps:
$ unzip newdata.zip
$ psql -d news -f newsdata.sql
Connect to news db
$ psql -d news
CREATE VIEW total_logs AS SELECT
date(time) as dt, count(*) AS total
FROM log GROUP BY date(time) ORDER BY total;
CREATE VIEW error_logs AS SELECT
date(time) as dt, count(*) AS error
FROM log WHERE status!='200 OK'
GROUP BY date(time) ORDER BY error;
$ python3 log_analysis.py