Pool select with active member check

Hello,

I have the irule below which was written to do the following:

All traffic that starts with path /abc goes to pool_A. If active members are less than 10 in pool_B then send to pool_C, otherwise send that traffic to pool_B

The issue I’m seeing is that all traffic that does not start with /abc is being sent to Pool C. It never goes to Pool_B even though pool_B has more than 10 members. There are no other irules or policies on the VIP. Any insight would be appreciated.

when HTTP_REQUEST {
   if { [HTTP::path] starts_with "/abc" } {
        pool pool_A
    } elseif { [active_members pool_B] < 10 } {
        pool pool_C
    } else {
        pool pool_B
    }
}

Hi,

Can you change the code with log commands:

when HTTP_REQUEST {
   if { [HTTP::path] starts_with "/abc" } {
        pool pool_A
    } elseif { [active_members pool_B] < 10 } {
        log "pool_C selected, there are [active_members pool_B] active members in Pool_B"
        pool pool_C
    } else {
        log "pool_B selected, there are [active_members pool_B] active members in Pool_B"
        pool pool_B
    }
}

Logging was a perfect idea. It proved the F5 was sending the traffic to the correct place. I worked with the server folks and they did see where it was going to the correct place. Thank You!

Apr  8 11:55:24 ltm-01 info tmm1[13043]: 01220002:6: Rule /Common/irule_x_pool_select : pool_B selected, there are 27 active members in pool_B
Apr  8 11:55:24 ltm-01 info tmm1[13043]: 01220002:6: Rule /Common/irule_x_pool_select : pool_B selected, there are 27 active members in pool_B
Apr  8 11:55:24 ltm-01 info tmm[13043]: 01220002:6: Rule /Common/irule_x_pool_select : pool_B selected, there are 27 active members in pool_B
Apr  8 11:55:24 ltm-01 info tmm1[13043]: 01220002:6: Rule /Common/irule_x_pool_select : pool_B selected, there are 27 active members in pool_B
Apr  8 11:55:24 ltm-01 info tmm1[13043]: 01220002:6: Rule /Common/irule_x_pool_select : pool_B selected, there are 27 active members in pool_B