Forum Discussion
Wildcard for Host Subdomains inside a Switch?
Hi Cames1,
your [switch -glob] code looks good and the HOST test.domain.com should normaly match the *.domain.com condition. Chaning to [switch -regexp] is not required for this simple condition, it would just put some heavy CPU load on your device. The performance impact of [switch -regexp] is realy impressive and should be avoided if possible...
My bet is, that you've saved and tested the iRule without opening and closing your browser (aka. establishing new TCP connections). Keep in mind that any changes to iRules would just affect any new TCP connections.
To see whats going on behind the scenes, you may also want to add some [log] statements...
log -noname local0.debug "Before switch: [string tolower [HTTP::host]]"
switch -glob -- [string tolower [HTTP::host]] {
"*.domain.com" {
log -noname local0.debug "*.domain.com switch!"
Do Something
}
default {
log -noname local0.debug "default switch!"
Do Something
}
}
Cheers, Kai
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