Forum Discussion
CraigM_17826
Altocumulus
Dec 21, 2009switch command
Hi all,
[Update: fixed the redirect issues so I've removed the examples from the thread. It was just my dyslexic typing]
I'm trying to clean up and optimise some of my iRules. Currently I have quite a large block of if blocks for pool selections. The basic form follows
if { [[string tolower [HTTP::uri]] contains "sometext" }{
pool "pool-name"
return
}
This all works. I have now tried the follwoing switch commands for the above cases
switch -glob [string tolower [HTTP::uri]] {
"sometext" {pool pool-name}
"sometext" {pool pool-name2}
}
What happens though is that the pool commands dont seem to work, I just get an error back from the webserver on the default pool saying the directory (as supplied by "sometext" does not exist.
I have tried with and without the -glob option and it doesn't seem to make a difference. I have run out of ideas at the moment. Any suggestions welcome.
Regards
Craig
- The_Bhattman
Nimbostratus
Hi Craig, - CraigM_17826
Altocumulus
Hi Bhattman,
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