def parse_events(logger, line):
 match = log_event_pattern.match(line)
 if match:
  groups = match.groupdict()
  groups.update({'alert_type': alert_types.get(groups['alert_type'], ''), 'timestamp': calendar.timegm(datetime.strptime(groups['timestamp'], '%Y-%m-%d %H:%M:%S').timetuple()), 'msg_text': line})
  return groups
 else:
  return None

def parse_events ( logger , line ) : match = log_event_pattern . match ( line ) if match : groups = match . groupdict ( ) groups . update ( { 'alert_type' : alert_types . get ( groups [ 'alert_type' ] , '' ) , 'timestamp' : calendar . timegm ( datetime . strptime ( groups [ 'timestamp' ] , '%Y-%m-%d %H:%M:%S' ) . timetuple ( ) ) , 'msg_text' : line } ) return groups else : return None
expecting lines like this: 2012-05-14 12:46:01 [error] - host0 is down .