def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 4781,
            "$" in event.deep_get("OldTargetUserName", default=""),
            not "$" in event.deep_get("NewTargetUserName", default=""),
        ]
    ):
        return True
    return False
