def rule(event):
    if any(
        [
            all(
                [
                    event.deep_get("SamAccountName", default="").startswith("SAMTHEADMIN-"),
                    event.deep_get("SamAccountName", default="").endswith("$"),
                ]
            ),
            all(
                [
                    event.deep_get("TargetUserName", default="").startswith("SAMTHEADMIN-"),
                    event.deep_get("TargetUserName", default="").endswith("$"),
                ]
            ),
        ]
    ):
        return True
    return False
