Forum Discussion
Tadaoki_237078
Nimbostratus
Dec 17, 2015iRules: Pool selection by URI and cookies
Hello everyone
I want to make an iRule which;
1) Select a pool by URI during first http request
2) For the subsequent requests for css and graphic files(with URI different than the first
req...
StephanManthey
Nacreous
Dec 17, 2015Hi Kai,
there are at least two aspects to consider:
1) a URI will start with a slash
/character. So the validation has to match a string of i.e "/foo", "/foo*", "*foo"
Without a literal slash or a wildcard as
* in case you are using globbing you will not get a match.
2) The function
HTTP::cookie names returns a list. A list cannot be matched versus a jump table as used by the switch command.
You want to use exact matches for an exact cookie name by using i.e.:
foreach cookie_name [HTTP::cookie names] {
switch $cookie_name {
"foo_named_cookie" {
return
}
"bar_named_cookie" {
return
}
}
}
It will be important to use a
return after running the action for a match to exit the evaluation.
Thanks, Stephan
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