Forum Discussion
Bryan_38320
Nimbostratus
Jul 16, 2010class match instead of findclass
I recently did an upgrade from 9.x to 10.1. Under 9.x we were using a class data structure for several hundred redirects.
Example:
class noclass {
"/notthissite1 http://w...
hoolio
Cirrostratus
Jul 16, 2010Hi Bryan,
Out of curiosity, what kind of performance hit did you see when testing findclass in 10.1 compared with the class commands? Did you compare matchclass with class as well? I haven't done any testing of this, so I'm wondering if it's a significant difference.
The format for a (non-external) name/value pair string datagroup in 10.1 is:
class my_string_datagroup {
{
"name1" { "value1" }
"name2" { "value2" }
"name3" { "value3" }
}
}
You can then use 'class search' to look up the value for a given name (URI, in your example):
set match [class search -value my_string_datagroup eq [string tolower [HTTP::uri]]]
'class match' just returns true or false (0 or 1 actually) based on whether the match of the token against the class is successful.
Aaron
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
