Forum Discussion
hooleylist
Dec 19, 2012Cirrostratus
Yes, the class command should return the longest match for starts_with or ends_with. I don't know about matchclass or findclass, but you could test this fairly easily.
https://devcentral.f5.com/wiki/iRules.class.ashx
Note: When using the equals operator on IP classes, or when using the starts_with or ends_with operators, if multiple possible matches are found in the class, then the longest match is always chosen. This is not true when using the contains operator. See the example below for more details.
You also have the -all flag to return all matching keys, values or elements:
-all If used with -index, -name, -value, -element, changes the return value to all of the matching class elements. (added in v11.0)
Aaron