Forum Discussion
Chris_Phillips
Nimbostratus
Dec 19, 2012does class match always find the BEST match?
Hi folks,
This seems like an odd thing to not find in the wiki already, but if i'm doing a "class match starts_with" operation, will the BEST match always be found in the ist, i.e. the lo...
hoolio
Cirrostratus
Dec 19, 2012Yes, 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects