import typing


def add_metadata(record: typing.Dict, line: str, filename: str) -> typing.Dict:
    """
    Add common metadata to match _in place_
    line: the line the match was based on
    filename: the name of the logfile the log was found in
    """
    extra_metadata = {
        "@input": "s3",
        "@shipper.name": "elb_log_ingestor",
        "@version": "1",
        "@raw": line,
        "@level": "INFO",
        "tags": [],
        "path": filename,
    }
    return {**record, **extra_metadata}