Given a list of log lines, implement a function that processes them in a single pass and returns aggregated counts per severity level. Each valid line has the format timestamp|event_id|severity|message, where severity is one of INFO, WARN, or ERROR. Ignore malformed lines, and count each event_id only once so duplicate records do not affect the result. Return a dictionary with keys INFO, WARN, ERROR, invalid, and duplicates.
1 <= len(logs) <= 10^51 and 10^4INFO, WARN, and ERRORevent_id comparison is case-sensitive