Jump to content

Featured Replies

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

 

  • Views 45
  • Created
  • Last Reply

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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.