Forum Discussion

RACQ_74493's avatar
Jan 04, 2011

post about how to modify default pool behaviour

Hello,

 

I found a post on an irule to to send traffic to different pool based on URL and it also discussed how to change the behaviour of the default pool and I cannot find it.

 

 

I have an irule that has some 30 different pools and if none of the url matches occur I don't want to it go to the default pool on the VIP I need to send it to a naughty corner!

 

 

Can anyone assist?

 

 

Thanks

 

David.

13 Replies

  • You could have as many URI:Blocked IP relationships as you wanted inside the class

    Yes, however the way I read the class search doco it will hit the first match of the URI and go no further.

    So the second or third etc entries for the same URI will never be matched and one would never get ther desired behaviour.

    Or have I got it arse about? I mean the thing the class is matching is the URI and returning the IP Address so I don't see why it would continue through the class trying other matches?

    I see that one can return all results of the class that match but then one would have to do some funky regex (??) to then match the string and that is way beyond this cowboy's skills.

    
    class search []   
      Returns 0 or 1 depending on whether an element in  matches  according to the .
      This command form is equivalent to the current iRule command: matchclass   .
      Example:
        class search blocked_paths starts_with [HTTP::uri]
        Read as: does blocked_paths contain an element that starts with the uri.
      The options for both of the above forms of the class command can be:
        -indexChanges the return value to be the index of the matching class element.
        -nameChanges the return value to be the name of the matching class element.
        -valueChanges the return value to be the value of the matching class element.
        -elementChanges the return value to be a list of the name and value of the matching class element.
        -allWhen used with the above options, returns a list of all matching elements, not just the first.
        --Terminates option processing (useful if the item or '' begins with a hyphen).
      The  for both of the above forms can be:
        equals, starts_with, ends_with, contains
     

    David.
  • Posted By RACQ on 01/07/2011 01:26 PM

    You could have as many URI:Blocked IP relationships as you wanted inside the class

    Yes, however the way I read the class search doco it will hit the first match of the URI and go no further.

    So the second or third etc entries for the same URI will never be matched and one would never get ther desired behaviour.

    Or have I got it arse about? I mean the thing the class is matching is the URI and returning the IP Address so I don't see why it would continue through the class trying other matches?

    I see that one can return all results of the class that match but then one would have to do some funky regex (??) to then match the string and that is way beyond this cowboy's skills.

    class search []   
      Returns 0 or 1 depending on whether an element in  matches  according to the .
      This command form is equivalent to the current iRule command: matchclass   .
      Example:
        class search blocked_paths starts_with [HTTP::uri]
        Read as: does blocked_paths contain an element that starts with the uri.
      The options for both of the above forms of the class command can be:
        -indexChanges the return value to be the index of the matching class element.
        -nameChanges the return value to be the name of the matching class element.
        -valueChanges the return value to be the value of the matching class element.
        -elementChanges the return value to be a list of the name and value of the matching class element.
        -allWhen used with the above options, returns a list of all matching elements, not just the first.
        --Terminates option processing (useful if the item or '' begins with a hyphen).
      The  for both of the above forms can be:
        equals, starts_with, ends_with, contains
     

    David.

    I misunderstood what you were looking for...classes might not be the way to go here, you might have to use an address-type datagroup and list out the URIs in the rule.
  • Hi Chris,

     

    Yes which is the point I started at, a BIG swith list of 30 or so URIs and their associated pools with embedded switch statements for those URI that need security applied to them.

     

    I was really hoping to avoid such a beast where one spelling error or misplaced colon could rium someones day!

     

     

    Thanks

     

    David.