Forum Discussion
d2_21508
Oct 06, 2015Nimbostratus
is it possible to use regex within switch block?
Hello!
Is it possible to use regular expressions within switch block? My scenario:
a.domain.com a.domain.net
So different TLDs. Now I want to write iRule that will handle both 'com' and 'net...
Stanislas_Piro2
Oct 06, 2015Cumulonimbus
Hi,
you can use this syntax:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"a.domain.com" -
"a.domain.net" {
pool some_pool_a
}
"b.domain.com" -
"b.domain.net" {
pool some_pool_b
}
}
}
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