Forum Discussion
CTS_14402
Nimbostratus
Nov 18, 2004How to use findclass?
Hello,
I wrote the following rule.
However the rule do not output anything.
How to use the "findclass()" command?
log [getfield [findclass "abc" test-class] " " 2]
The type of "test-class" is string.
And the contents is
abc 192.168.1.1
def 192.168.1.2
ghi 192.168.1.3
Regards.
4 Replies
- Nat_Thirasuttakorn
Employee
you may try with $::test-class as in SOL3386 - For those who don't know, SOL's are F5 Solutions that are posted on our F5 Technical Support Center website http://ask.f5.com
-Joe - CTS_14402
Nimbostratus
Thanks a lot! - unRuleY_95363Historic F5 AccountI'd like to add that there is a shortcut to using getfield with findclass.
findclass takes an optional 3rd argument which is the separator. When the class item is matched the separator will split the class and the trailing portion will be returned.
In example, these are equivalent:set foo [getfield [findclass "something" $::my_class] " " 2]set foo [findclass "something" $::my_class " "]
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