Forum Discussion
together_183451
Nimbostratus
Jan 23, 2015Following iRule not working in my setup please correct mistake if found
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "mfcomb.birlasunlife.com" } {
if { ([string tolower [HTTP::uri]] starts_with "/media") or
([string tolower [H...
StephanManthey
Nacreous
Jan 30, 2015Hi together,
it was probably a missing brace. Here are two versions for your requirement. The second one uses "switch" and is probably faster and easier to read/maintain. Please note the following about "switch": - a "-" is kind of "or" comparision. In case of a match the next following decision will apply, i.e. selection of pool Talisma_MF_Webchat - the "default" condition at the end of the list will match all unmatched validations.when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "mfcomb.test.com" } {
if { ([string tolower [HTTP::uri]] starts_with "/media") or
([string tolower [HTTP::uri]] starts_with "/mediaupload") or
([string tolower [HTTP::uri]] starts_with "/webchat") or
([string tolower [HTTP::uri]] starts_with "/webtrak") }{
pool Talisma_MF_Webchat
}
} elseif { [string tolower [HTTP::host]] equals "abibluat.test.com" } {
pool abibluat_pool
} elseif { [string tolower [HTTP::host]] equals "abfluat.test.com" } {
pool abfluat_pool
} elseif { [string tolower [HTTP::host]] equals "pmsuat.test.com" } {
pool PMSUAT
} elseif { [string tolower [HTTP::host]] equals "peuat.test.com" } {
pool peuat_pool
} elseif { [string tolower [HTTP::host]] equals "uat.test.com" } {
pool UAT_test
} else {
pool UAT_pool
}
}
when HTTP__REQUEST {
switch [string tolower [HTTP::host]] {
"mfcomb.test.com" {
switch -glob [string tolower [HTTP::uri]] {
"/media" -
"/mediaupload" -
"/webchat" -
"/webtrak") { pool Talisma_MF_Webchat }
}
}
"abibluat.test.com" { pool abibluat_pool }
"abfluat.test.com" { pool abfluat_pool }
"pmsuat.test.com" { pool PMSUAT }
"peuat.test.com" { pool peuat_pool }
"uat.test.com" { pool UAT_test }
default { pool UAT_pool }
}
Further I would like to ask you for two things, please:
1. Would you please mark a question as answered by tagging the response as solution. This will help to keep track of open questions. 2. Please open a new question in case your question is dealing with another subject. Thanks & enjoy weekend, StephanHelp guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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