Using [IP::addr [IP::client_addr] in HTTP_REQUEST event
Hi, I'm trying to use the IP address to redirect requests to a particular pool after the uri has been checked. I am getting the following error:
01070151:3: Rule [xxx_irule] error: line 15: [undefined procedure: elseif] [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 }]
Ive found a few suggestions in the forum, but none seem to apply.
Can anyone help? Thanks.
This is my irule
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 } } }