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 126
  • Created
  • Last Reply

Create an account or sign in to comment

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.