Forum Discussion
dlg_23340
Nov 23, 2011Cirrus
"class match starts_with" behavior
My own testing seems to indicate that the return of [class match -value -- $var starts_with data_group] returns the value of the longest key, but I can't find any documentation to support this. Can a...
nitass
Nov 23, 2011Employee
i have seen ID222001 "class match" and "class search" need "-all" parameter which mentioning the first entry will be returned but as i tested, i got the same result as yours. not sure if i missed anything. does another guy get similar result??
[root@ve1023:Active] config b rule myrule list
rule myrule {
when RULE_INIT {
log local0. "foo: [class get foo]"
for {set i 0} {$i < [class size foo]} {incr i} {
log local0. "index$i: [class element $i foo]"
}
log local0. "\[class match -value abcdef starts_with foo\]: [class match -value abcdef starts_with foo]"
}
}
[root@ve1023:Active] config b class foo list
class foo {
{
"ab" { "333" }
"abc" { "111" }
"abcd" { "222" }
}
}
[root@ve1023:Active] config tail /var/log/ltm
Nov 23 13:48:04 local/ve1023 err mcpd[21973]: 01020066:3: The requested rule (myrule) already exists in partition Common.
Nov 23 13:48:05 local/tmm info tmm[23027]: Rule myrule : foo: {abc 111} {abcd 222} {ab 333}
Nov 23 13:48:05 local/tmm info tmm[23027]: Rule myrule : index0: abc 111
Nov 23 13:48:05 local/tmm info tmm[23027]: Rule myrule : index1: abcd 222
Nov 23 13:48:05 local/tmm info tmm[23027]: Rule myrule : index2: ab 333
Nov 23 13:48:05 local/tmm info tmm[23027]: Rule myrule : [class match -value abcdef starts_with foo]: 222
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