redirect based on pool member status

i am looking for an irule that will redirects base on the pool member status, meaning that if less than 3 member is availble on this pool it will redirects.

thanks

Hi Shay,

You can use active active_members $pool_name to get a count of the active members:

when HTTP_REQUEST { 
  
     Check if there are more than x members marked up in the default pool 
    if {[active members [LB::server pool]] < 3}{ 
  
       HTTP::respond 302 "Location" "http://redirected.example.com/busy" \ 
 "Connection" "Close" \ 
 "Cache-Control" "no-cache" \ 
 "Pragma" "no-cache" 
    } 
 }

LB::server (Click here)

active_members (Click here)

Aaron