iRule assistance
Dear Dev Central,
I have some specific requirements for an iRule but am not exactly sure how to make it all work in one iRule or if I should use 2 iRules evaluated sequentially. The iRules are as follows:
when HTTP_REQUEST {
if {[HTTP::path] starts_with "/resources/" } {
pool pool_atldevngn
when HTTP_REQUEST {
if { !([class match [HTTP::uri] contains api_string])} {
discard
log local0. "connection DISCARDED from [IP::client_addr]"
} else {
pool pool_atlapipool1
The first iRule obviously states that if the http path starts with "/resources/" then send that traffic to the "pool_atldevngn" pool. The second irule is a little more complex. This irule states that if the uri DOES NOT contain any of the specified strings preconfigured in the "api_string" Data Group List then drop and log that traffic otherwise just send the traffic to the "pool_atlapipool1" pool.
My question is this: Should I keep these as two separate irules, evaluating the "resources" irule first and then the other? or is there a way to create what would basically be a multi if-elseif branch irule? I am having trouble figuring out how to format it into one iRule.
Any help you can provide would be great! Thanks!