def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") in [2004, 2071, 2097],
            any(
                [
                    ":\\PerfLogs\\" in event.deep_get("ApplicationPath", default=""),
                    ":\\Temp\\" in event.deep_get("ApplicationPath", default=""),
                    ":\\Tmp\\" in event.deep_get("ApplicationPath", default=""),
                    ":\\Users\\Public\\" in event.deep_get("ApplicationPath", default=""),
                    ":\\Windows\\Tasks\\" in event.deep_get("ApplicationPath", default=""),
                    ":\\Windows\\Temp\\" in event.deep_get("ApplicationPath", default=""),
                    "\\AppData\\Local\\Temp\\" in event.deep_get("ApplicationPath", default=""),
                ]
            ),
            not event.deep_get("Action", default="") == 2,
        ]
    ):
        return True
    return False
