Forum Discussion
Brent_Sachnoff_
Nimbostratus
Oct 23, 2007Using switch with uri
I'm having some issues using the switch command and uri's. I believe the switch command is only for EQUALS to something for it to work properly which means this wouldn't work at all. Here is a sample...
Brent_Sachnoff_
Nimbostratus
Oct 31, 2007Aaron 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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects