Step 1: The question and a first look
In this project you play a site reliability analyst. A web server writes one line to its log for every request: when, who (IP address), what (method and path), the status code and how long it took in milliseconds. Your job: turn thousands of lines into answers. How many requests failed? Which pages are slow? Is someone trying to break into the login page?
The sample log has 19 lines (one is deliberately malformed, because real logs always contain junk). The finished tool will parse it, summarise status codes and the error rate, find popular and slow endpoints, bucket traffic by minute, flag suspicious IP addresses and print a report. Everything runs in your browser with Python and SQL.
First, the old-fashioned way. Unix has a tradition of answering log questions with small tools joined by pipes. Try this on a tiny log in the practice terminal; later you will do the same job more flexibly in Python:
grep -c counts matching lines, sort | uniq -c counts how often each distinct line appears. These are great for a quick look, but a program is better once you need percentages, time buckets and rules.
Which pipeline counts how often each distinct line occurs?
Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.
Tip: use the left and right arrow keys to move between lessons.