title: Log parsing in Python: Alert if more than N errors in a given period?
body: <p>I have a log file that contains an hour's worth of data.</p>
  
  <p>I'd like to generate an alert if there are more than N errors recorded within any 5-minute period within that log.</p>
  
  <p>What I <em>don't</em> want to do is designate 5-minute periods (e.g. 00-05, 06-10, etc.) and iterate through them, because if N=10, and I have 8 errors at 04 and 8 errors at 07, they'll be treated as in two separate buckets and won't generate the alert.</p>
  
  <p>I suppose I could instead iterate 60 times, advancing 1 minute each time, and consider the 5-minute bucket from that point, but is there a more elegant or more performant way?</p>