Forum Discussion
peter_siman
Nimbostratus
May 29, 2011Pool selection based on URI string
Hi,
I have writtend a simple iRule to select particular pool based on what the URI string is. See below the iRule. Unfortunatelly, when applied a following messsages show up in logs.
...
hoolio
Cirrostratus
May 31, 2011As Bhattman said, [IP::server_addr] only works after a serverside connection has been established. You can use [LB::server] in the LB_SELECTED event when a load balancing selection has been made to get the selected server info. Or you can use [IP::server_addr] in or after SERVER_CONNECTED.
Also, if you're using this iRule with an IIS-based application, you should set the path to lowercase before doing a comparison as IIS is case-insensitive for the paths:
when HTTP_REQUEST {
log local0. "Erimo request received"
if { [string tolower [HTTP::path]] equals "/aprimomarketing/login.aspx" } {
log local0. "Erimo request for Aprimo service received. Selecting end server"
pool Node_Web_ESESSMW1432
}
else {
pool wam_erimo_pool
log local0. "Condition not matched. No Aprimo server selected."
}
}
when SERVER_CONNECTED {
log local0. "Connection from [IP::client_addr]:[TCP::client_port] to Aprimo server: [IP::server_addr]:[TCP::server_port] established."
}
Aaron
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