Forum Discussion
FishNiX_29746
Nimbostratus
Jan 25, 2010HOST/URI to pool mapping via iRule and class and trailing /
Greetings -
I'm attempting to write a generic iRule to send traffic for a URI to a specific pool. I will use this over "many" virtuals with "many" URIs.
I've ...
The_Bhattman
Nimbostratus
Jan 26, 2010Hi FishNiX,
I think you might be able speed things up if you avoid using the FOR loop
class host_uri_pool_selector_class {
"docs.foobar.edu /foo/ opa_pool"
"docs.foobar.edu /foobar/ baz_pool"
"test.foobar.edu /bar/ bar_pool"
}
rule set_pool_by_host_and_uri {
when HTTP_REQUEST {
set row [findclass [string tolower[HTTP::host]] $::host_uri_selector_class
if { [string tolower [HTTP::host]] equals [getfield $row " " 1] } {
if { [string tolower [HTTP::uri]] starts_with [getfield $row " " 2] } {
pool [getfield $row " " 3]
}
}
unset row
}
}
I hope this helps
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
