Forum Discussion
Faintly_Lucky
Nimbostratus
Apr 24, 2010Second set of eyes, please
Hello all:
I wrote this iRule with people who don't have many public addresses or have found the need to conserve them in mind. I just started a new job, so I don't have access to any F5s to c...
hoolio
Cirrostratus
Apr 25, 2010Hi Lucky,
As Matt suggested, if you're wanting to test on 10.1.x, LTM VE is a great option.
I think it would be more efficient to define the host to pool mapping in a datagroup rather than defining the mapping in an array that you declare for every request. You can use findclass to look up the host in the class:
String type datagroup which maps the host names to pool names:
class host_pool_map_class {
"host1 pool1"
"host_other some_pool"
}
iRule which references the datagroup:
when HTTP_REQUEST {
Check if there is a host header value
if {[HTTP::host] ne "" {
Check if the requested Host is in the host_pool_map_class datagroup
set my_pool [findclass [string tolower [HTTP::host]] $::host_pool_map_class " "]
if { $my_pool ne "" } {
pool $my_pool
}
}
}
Note, if you're on 9.4.4 or higher, you should remove the $:: prefix from the iRule's reference of the datagroup.
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
