Forum Discussion
hoolio
Cirrostratus
Nov 03, 2009v10 class matches_glob type functionality?
Hi,
There is a v9 iRule I'm trying to convert and have CMP compatible. The current functionality required using a global TCL list of the format:
set ::global_list [list ...
hoolio
Cirrostratus
Nov 18, 2009I ended up using class element to do this, but it seems like extra work that could be made more efficient (or easier) with a glob_match style option for the class command.
Loop through each class line
for {set i 0} {$i < [class size my_dgl]} {incr i} {
Use scan to parse the two fields from the class
scan [class element -name $i my_dgl] {%[^ ]%s} my_pattern my_value
Use string match to evaluate the pattern against the string
if {[string match -nocase $my_pattern [HTTP::uri]]}{
Found a match
log local0. "Matched $my_pattern, using $my_value"
break
}
}
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