We are starting to use iRules to collapse our quantity of VIPs/Points of entry for lower environments. Where in the past we would create VIPs for each application, our porferenece now is to use iRules and host headers to halt the sprawl. Our goal is to create a single iRule that can use a portion of the hostname to route traffic to an associated pool. For example, if the URL is www.ENV1.weightwatchers.com, the traffic would need to be routed to the associated pool_www.ENV1.weightwatchers.com. Is there a way to create a variable from the ENV1 name and pass that into a matching pool so I can have a single universal iRule as opposed to creating one iRule per environment?
e.g.
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [catch {pool pool_[HTTP::host]}] } {
default pool
pool foo
}
}
}
iRules 101 - 07 - Catch by Joe Pruitt