Forum Discussion
Jeff_Wyant_4852
Nimbostratus
Jun 19, 2006Filter Mulitple Http Requests to Serveral Pools
I need an irule to filter traffic to send it to the correct pool (total of 3 pools) based on the URL. I have a start but need help with this irule.
when HTTP_REQUEST {
if { [HTTP::ur...
Jun 19, 2006
There are a couple of issues here.
First, you have three HTTP_REQUEST events in your rule. Consolidate all your logic into a single when statement.
Second, here's the breakdown for a url
http://www.foo.com/bar
http://[HTTP::host][HTTP::uri]
In this case [HTTP::host] would be "www.foo.com"
and [HTTP::uri] would be "/bar".
You are comparing the URI (HTTP::uri) to both the HTTP::host and HTTP::uri.
You can either rearrange your logic to compare both the host and uri with a logical "and" or break it down into multiple if/elses. Or, if you want to be a real geek, go for a switch statement (search the forums for switch examples). If you get stuck, either search the forums or browse the CodeShare section of the iRules Wiki, there are a bunch of examples in there of exactly this functionality.
-Joe
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