Parses a log line using the regexices above.
    :param line: A log line to be parsed.
    :return: If no match is found, None, otherwise a dict containing the values parsed from the log line.

def parse(line):
    """
    Parses a log line using the regexices above.
    :param line: A log line to be parsed.
    :return: If no match is found, None, otherwise a dict containing the values parsed from the log line.
    """
    values = None
    matches = re.search(regex, line)
    if matches:

        # Standard values
        values = {
            'date_time': matches.group(DATE_TIME),
            'log_level': matches.group(LOG_LEVEL),
            'process_id': matches.group(PROCESS_ID),
            'thread_name': matches.group(THREAD_NAME),
            'logger_name': matches.group(LOGGER_NAME),
            'log_message': matches.group(LOG_MESSAGE)
        }

        # Optional transaction tracking information
        if matches.group(TRANSACTION):
            values["transaction"] = {
                "app": matches.group(TRANSACTION_APP),
                "id": matches.group(TRANSACTION_ID),
                "span": matches.group(TRANSACTION_SPAN),
                "exported": matches.group(TRANSACTION_EXPORTED)
            }

    return values