Peak Error Time Detection

Log Analysis Data Processing Time Series

You are provided with a log file containing entries from multiple servers. Each log entry is formatted as follows:

[timestamp] [server_id] [event_type]
  • The timestamp is in ISO 8601 format (e.g., 2025-03-16T14:23:05Z).
  • The server_id is a unique identifier for the server.
  • The event_type can be values like INFO, WARNING, or ERROR.

Your task is to write a program that processes this log file and identifies periods during which the number of ERROR events exceeds a given threshold within a sliding time window (in minutes). The program should output a summary that includes:

  1. The start and end timestamps of each time window where the error count exceeds the threshold.
  2. The total number of ERROR events that occurred within each detected window.
  3. A list of affected server IDs during those periods.

The program should handle large log files efficiently and allow the user to configure both the error threshold and the window size in minutes. Edge cases, such as log files with no ERROR events or when the window spans the end of the file, should also be considered.

Design and implement this solution ensuring clarity, efficiency, and scalability.


Loading...