# Pool select with active member check

**URL:** <https://community.f5.com/t/pool-select-with-active-member-check/25796>\
**Category:** Technical Forums\
**Tags:** irules, big-ip, application-delivery\
**Created:** [April 8, 2019, 3:02pm UTC](https://community.f5.com/t/pool-select-with-active-member-check/25796 "2019-04-08T15:02:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elandreth\_29975](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@elandreth\_29975](https://community.f5.com/u/elandreth_29975)\
**Post date:** [April 8, 2019, 3:02pm UTC](https://community.f5.com/t/pool-select-with-active-member-check/25796/1 "2019-04-08T15:02:03Z")

</div>

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.

```tcl
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
    }
}

```

---

<div class="post-metadata">

**Author:** ![stan\_piron](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stan\_piron](https://community.f5.com/u/stan_piron)\
**Post date:** [April 8, 2019, 3:44pm UTC](https://community.f5.com/t/pool-select-with-active-member-check/25796/2 "2019-04-08T15:44:07Z")

</div>

Hi,

Can you change the code with log commands:

```tcl
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
    }
}

```

---

<div class="post-metadata">

**Author:** ![elandreth\_29975](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@elandreth\_29975](https://community.f5.com/u/elandreth_29975)\
**Post date:** [April 8, 2019, 7:20pm UTC](https://community.f5.com/t/pool-select-with-active-member-check/25796/3 "2019-04-08T19:20:57Z")

</div>

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!

```tcl
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

```
