How can I use pre-defined "Persistence Profiles" in iRule?

Can someone please help with how to use pre-defined “Persistence Profiles” in iRule?

My persistence profile “my-cookie-insert” has already created.

The iRule ,i want to use “my-cookie-insert” in, is follow:

when HTTP_REQUEST {

if { [HTTP::uri] starts_with “/a/” } {

pool pool01

} else {

pool pool02

}

}

i want to apply my profile “my-cookie-insert” when HTTP::uri starts with “/a/”.

(i.e. when the iRule sets the pool “pool01”)

You can’t specify a custom persistence profile. Though you can specify all the attributes of a custom persistence profile in an iRule using the persist command (Click here:disappointed_face:

when HTTP_REQUEST { 
    if { [HTTP::uri] starts_with "/a/" } { 
       pool pool01 
        Specify cookie insert persistence using name COOKIE_NAME with a timeout of 600 seconds 
       persist cookie insert COOKIE_NAME 600 
    } else { 
       pool pool02 
    } 
 }

Aaron