import json


def rule(event):
    if all(
        [
            event.deep_get("cs-method", default="") == "POST",
            event.deep_get("sc-status", default="") == 200,
            event.deep_get("cs-username", default="") == "anonymous",
            any(
                [
                    all(
                        [
                            "/pages/createpage-entervariables.action"
                            in event.deep_get("cs-uri-query", default=""),
                            "SpaceKey=x" in event.deep_get("cs-uri-query", default=""),
                        ]
                    ),
                    all(
                        [
                            "/doenterpagevariables.action"
                            in event.deep_get("cs-uri-query", default=""),
                            "u0027" in json.dumps(event.to_dict()),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
