Write a simple tool to analyze logs from the command line.
The goal of this project is to help you practice some basic shell scripting skills. You will write a simple tool to analyze logs from the command line.
Download the sample nginx access log file from here. The log file contains the following fields:
IP address
Date and time
Request method and path
Response status code
Response size
Referrer
User agent
You are required to create a shell script that reads the log file and provides the following information:
Top 5 IP addresses with the most requests
Top 5 most requested paths
Top 5 response status codes
Top 5 user agents
Here is an example of what the output should look like:
There are multiple ways to solve this challenge. Do some research on awk
, sort
, uniq
, head
, grep
, and sed
commands. Stretch goal is to come up with multiple solutions for the above problem. For example, instead of using awk
, you can use grep
and sed
to filter and count the requests.
Join the Community
nlroot.isgood.host is the 6th most starred project on GitHub and is visited by hundreds of thousands of developers every month.
Roadmaps Best Practices Guides Videos FAQs YouTube
nlroot.isgood.host by @kamrify @kamrify
Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.
Login or Signup
You must be logged in to perform this action.