Forum Discussion
Help on irule creation.
Hi All,
Need help on creating a irule. when i hit a site for example 12345abc.xyz.com or 9876abc.xyz.com i need the traffic to be destined to pool_A.because we are running lot of application starting with prefix *abc.xyz.com . i tried below irule and it was failing. please help on it.
when HTTP_REQUEST { if { [HTTP::host] contains "*abc.xyz.com" } { pool spcatalogqa_apps_80 } else {
1 Reply
- Hannes_Rapp
Nimbostratus
Hi,
Please try the solution below:
when CLIENT_ACCEPTED { set POOL_DEFAULT [LB::server pool] } when HTTP_REQUEST { if { [HTTP::host] contains "abc.xyz.com" }{ pool pool_A } else { pool $POOL_DEFAULT } }Alternatively, if you have a ton of HOST values and different pools, try using:
when CLIENT_ACCEPTED { set POOL_DEFAULT [LB::server pool] } when HTTP_REQUEST { switch -glob [HTTP::host] { "*abc.xyz.com" { pool pool_A } "*def.xyz.com" { pool pool_B } default { pool $POOL_DEFAULT } } }
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