Forum Discussion
Festus_50639
Nimbostratus
Dec 01, 2008"Select pool based on uri content" iRule doesn't seem to be working
Good morning,
I have an iRule that is designed to select a pool based on a string found in the uri and it doesn't seem to be working. I have a log that collects the uri for reference....
Festus_50639
Nimbostratus
Aug 20, 2009The previous rule and its associated data class list have undergone some transformations.
We now have a simplified data class list using only the service name. I will provide an example below using the actual class name and dummy content.
esb_svcname_class {
"service1"
"service2"
"service3"
"service4"
}
In addition to streamlining the class, the logic determining whether both services on the same server are up was replaced by putting two health monitors on each pool and requiring that all health monitors be successful in order for a node to be considered "up".
The current rule is as follows. However, the requests are being sent to the VIP port rather than the appropriate port for the specific pool.
when HTTP_REQUEST {
log local0. "==ESB URI requested is [HTTP::uri]=="
set svc_uri [string tolower [getfield [HTTP::uri] ? 1]]
set svc_name [getfield $svc_uri "eproxy/service/" 2]
set front "esb_"
set back "_pool"
set svc_pool [concat $front$svc_name$back]
log local0. "--Service name is $svc_name--"
log local0. "--Service pool is $svc_pool--"
if { [ matchclass $::esb_svcname_class contains $svc_name] } {
pool $svc_pool
log local0. "--Request sent to $svc_pool--"
} else {
pool esb_policyagent_pool
log local0. "==ESB Service $svc_name was not defined. Policy Agent pool selected=="
}
}
Am I missing an eval or LB::select to make sure I'm sending the traffic to the port on the selected pool member instead of the VIP port?
Thanks,
Kevin
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