Forum Discussion
jtostado_47719
Nimbostratus
Oct 21, 2009BIGIP 4.5 to 9.3.1 iRule Conversion
I need help converting this rule:
if (http_uri ends_with one of portal_redirect_class) {
redirect to "https://psp-portal.com/portal/server.pt"}
else {
use pool SHAR...
The_Bhattman
Nimbostratus
Mar 01, 2010Duh....I forgot about "contains one of operator" is for classes.
Then the code would be re-written as
class eligibility {
"somethingsomething"
}
class images {
".jpg"
".gif"
}
when HTTP_REQUEST {
if {[IP::addr[IP::client_addr] equals 10.1.1.1] } {
if { [matchclass [string tolower [HTTP::uri]] contains $::eligibility] } {
pool POOL_230_2
} else {
pool POOL_230_1
}
} elseif {[IP::add [IP::client_addr] eq 10.1.1.8] } {
pool POOL_230_ALL
} else {
switch [HTTP::method] {
"GET" { log local0. "GET method used" }
"POST" { log local0. "POST method used"}
default { log local0. "Unexpected method used" }
}
if { [matchclass [string tolower [HTTP::uri]] contains $::eligibility ]} {
pool POOL_230_2
log local0. "Eligibility request made."
} elseif { [matchclass [string tolower [HTTP::uri]] ends_with $::images ]} {
pool POOL_230_ALL
log local0. "Image request Made"
} else {
pool pool_230_1
log local0. "Generic Request Made"
}
}
}
}
I hope this helps
Bhattman
Help 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