Forum Discussion
Kevin_Stewart
Apr 24, 2014Employee
There's a flaw in the logic, but not exactly sure what your intentions are. Here's the iRule reformatted approximation so you cane see what I mean:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/a1" } {
pool a_1_HTTP
} elseif { [HTTP::uri] starts_with "/a2" } {
pool a_2
} elseif { [HTTP::uri] starts_with "/a3" } {
pool a_3
} elseif { [HTTP::uri] starts_with "/health" } {
pool a_1_HTTP_HEALTH
} elseif { [HTTP::uri] starts_with "/ism" } {
elseif { [IP::addr [IP::client_addr] equals 10.100.128.0/18 or 10.200.128.0/18 ] } {
pool a_1_ism
} elseif { [HTTP::uri] starts_with "" } {
pool a_1_HTTP
}
}
}
-
Right below /ism URI check you're either missing some command, or attempting to drop into a subcondition (URI starts with /ism AND the IP address matches). If the latter, you're starting a condition block with an elseif instead of an if, which is what you're seeing in the errors.
-
For the IP address check, you'd actually need to do something like this:
{ ( [IP::addr [IP::client_addr] equals 10.100.128.0/18] ) or ( [IP::addr [IP::client_addr] equals 10.200.128.0/18] ) }