Forum Discussion

Shane_Terrick_9's avatar
Shane_Terrick_9
Icon for Nimbostratus rankNimbostratus
Jun 04, 2013

irule to direct /sample to pool others to default

I am coming up with the following for when somone hits the /samples uri they go to pool H3DEV_EA but when they don't hit that we want them to go to another pool(unfortunatle only one pool(server) built at the moment )

 

I keep getting an error with the following irule. Any help on my sytax woudl be greatly appreciated.

 

originally came up with this.

 

 

when HTTP_REQUEST {

 

switch -glob [string tolower [HTTP::uri]] {

 

/sample* - {

 

pool pool_A

 

}

 

default {

 

pool pool_B

 

}

 

}

 

}

 

}

 

 

 

But then came up with teh following after reading this(http://support.f5.com/kb/en-us/solutions/public/7000/900/sol7988.html)

 

rule switch_rule2 {

 

when HTTP_REQUEST {

 

switch -glob [string tolower[HTTP::uri]] {

 

"/sample*" - {

 

pool H3DEV_EA

 

}

 

default{

 

pool H3DEV_EA

 

}

 

}

 

}

 

}

 

1 Reply

  • can you try this?

    [root@ve10:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
      switch -glob [string tolower [HTTP::uri]] {
        "/sample*" {
          pool H3DEV_EA
        }
        default {
          pool H3DEV_EA
        }
      }
    }
    }