def rule(event):
    if all(
        [
            any(
                [
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("\\wevtutil.exe"),
                                    event.deep_get("OriginalFileName", default="")
                                    == "wevtutil.exe",
                                ]
                            ),
                            any(
                                [
                                    "clear-log " in event.deep_get("CommandLine", default=""),
                                    " cl " in event.deep_get("CommandLine", default=""),
                                    "set-log " in event.deep_get("CommandLine", default=""),
                                    " sl " in event.deep_get("CommandLine", default=""),
                                    "lfn:" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell_ise.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                                ]
                            ),
                            any(
                                [
                                    any(
                                        [
                                            "Clear-EventLog "
                                            in event.deep_get("CommandLine", default=""),
                                            "Remove-EventLog "
                                            in event.deep_get("CommandLine", default=""),
                                            "Limit-EventLog "
                                            in event.deep_get("CommandLine", default=""),
                                            "Clear-WinEvent "
                                            in event.deep_get("CommandLine", default=""),
                                        ]
                                    ),
                                    all(
                                        [
                                            "Eventing.Reader.EventLogSession"
                                            in event.deep_get("CommandLine", default=""),
                                            "ClearLog" in event.deep_get("CommandLine", default=""),
                                        ]
                                    ),
                                    all(
                                        [
                                            "Diagnostics.EventLog"
                                            in event.deep_get("CommandLine", default=""),
                                            "Clear" in event.deep_get("CommandLine", default=""),
                                        ]
                                    ),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell_ise.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                                    event.deep_get("Image", default="").endswith("\\wmic.exe"),
                                ]
                            ),
                            "ClearEventLog" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            not all(
                [
                    event.deep_get("ParentImage", default="")
                    in ["C:\\Windows\\SysWOW64\\msiexec.exe", "C:\\Windows\\System32\\msiexec.exe"],
                    " sl " in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
