Forum Discussion

nrelihan_68143's avatar
Icon for Nimbostratus rankNimbostratus
Aug 02, 2011

Must the iRule always select a pool?




In my iRule I plan to use two pools, pool_bots and pool_default. Bot and crawler traffic will be sent to pool_bots and pool_default wil be used for all other traffic.


So just to be clear can I put this iRule on a virtual server that is pointing towards pool_default so I dont have to put in the line "pool pool_default" in the switch statment code?


Im just not 100% on the mechanics of the F5 Im afriad.












set hostname [string tolower [HTTP::host]]


set uri [string tolower [HTTP::uri]]


if { [matchclass [string tolower [HTTP::header User-Agent]] contains $::bots] } {


pool pool_bots}


else {



switch [whereis [IP::client_addr]] {



"IE" {


if {$hostname eq "" and not $uri starts_with "/ireland"} {


HTTP::redirect[HTTP::uri] } }



"GB" {


if {$hostname eq "" and not $uri starts_with "/ireland" } {








default {


if {$hostname eq "" and not $uri starts_with "/ireland" } {









2 Replies

  • You are correct.



    The default behavior for all traffic not matched in the iRule would be directed to the pool assigned to the Virtual Server that the iRule was applied on.
  • A small note: if you're on 9.4.4 or higher, you should remove the $:: prefix from the datagroup name. Pre-v10 this was a best practice, but in v10 and higher, it's a requirement for the rule to work.