Forum Discussion
URL pattern match and substitution
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?
1 Reply
- nitass
Employee
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
https://devcentral.f5.com/articles/irules-101-07-catch.U1aB4ldhdQI
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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