Jump to content

Recommended Posts

Posted

Write a program that reads a server log file and analyzes it to provide the following information:

  1. The total number of requests.
  2. The top 5 IP addresses making requests.
  3. The most requested resource (URL).
  4. The number of 4xx and 5xx error codes encountered.

Bonus:

  • Add a feature to identify failed login attempts by looking for specific patterns like "login failed" or "authentication error."
  • Allow the user to input the path to the log file.

Example Output:

Total Requests: 12,345
Top 5 IPs:
  1. 192.168.1.1 - 1,234 requests
  2. 10.0.0.5 - 987 requests
  ...
Most Requested Resource: /index.html
4xx Errors: 456
5xx Errors: 123

 

CodeName: Jessica

💻 Linux Enthusiast | 🌍 Adventurer | 🦄 Unicorn 
🌐 My Site | 📢 Join the Forum

spacer.png

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.