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.