Aaron that gave me my answer! If we take this a step further, by inserting a cookie based on which case was matched I could use this for persistance. The F5 is throwing an error with my choice:
switch -glob [HTTP::uri] {
"/cc/*" {
if { ![HTTP::cookie exists "cc"] } {
persist cookie insert name cc
}
pool www2
}
The above works fine but has create some issues so I tried to set the path too. I changed the persist cookie line to:
persist cookie insert name cc value 123456 path "/cc"
The F5 complains: [wrong args]. Even if I get rid of the path portion it still complains about the same thing. Is there another way to use this command or another method that I should be looking at?
Thanks for all the responses so far. It has allowed me to rewrite some pretty nasty looking iRules.