Walk me through how you would analyze logs to identify key fields and extract important facts using string manipulation.
Implement extract_log_facts(logs). Each input line contains a timestamp, severity, event name, and optional key=value fields separated by whitespace. Values may be surrounded by double quotes and contain spaces. Return one dictionary per valid line with timestamp, level, event, and a fields dictionary. Ignore blank or malformed lines, and use the last value for duplicate keys.
def extract_log_facts(logs):