Write a script or function to parse a log file and identify patterns indicating a service outage.
Implement identify_outages(log_lines, threshold). Each line has the format timestamp|level|message. A line indicates an outage condition when its level is ERROR or CRITICAL. Return consecutive outage intervals containing at least threshold qualifying lines. Each result must contain the first timestamp, last timestamp, and number of qualifying lines. Ignore unrelated lines and malformed lines.
log_lines is a list of strings, and threshold is a positive integer. Return a list of dictionaries with keys start, end, and count, in chronological input order.
def identify_outages(log_lines, threshold):