Forum Discussion

Shawn_89418's avatar
Shawn_89418
Icon for Nimbostratus rankNimbostratus
Jun 11, 2012

irule to select from multiple pools?

Can you select a pool based on what comes after the fqdn? For instance

 

 

For UAT Site -

 

https://uat.site1.com/blah1 (/blah1 goes to application 1)

 

https://uat.site1.com/blah2 (/blah2 goes to application 2)

 

https://uat.site1.com/blah3 (/blah2 goes to application 3)

 

 

where /blah1 goes to application 1 which is in pool 1

 

and /blah2 goes to application 2 which is in pool 2

 

and /blah3 goes to application 3 which is in pool 3

 

and so on?

 

2 Replies

  • Hi Shawn,

     

     

    You can do this with a switch statement or if you have a lot (dozens or more) mappings, you could create a string data group with directory to pool mappings as name=value pairs and then use the class command to perform the lookup.

     

     

    See the switch and class command pages for details:

     

     

    https://devcentral.f5.com/wiki/iRules.switch.ashx

     

    https://devcentral.f5.com/wiki/iRules.class.ashx

     

     

    Aaron
  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account
    Like Hoolio says all you need to do is base to class lookup or switch on HTTP::uri. This will be even thing after the fqdn.