etc. With a class with ONE element, this chokes, as the $limit_element value is only the value itself, e.g. “200/1”, not the attribute name as well. With MORE elements in the list, it works great, and $limit_element is “/login 200/1” . Similarly this looks to be reflected in bigip.conf contents, as extra brackets exist etc.:
If you need to loop through the datagroup to perform an operation with the key or value, you can use a class loop:
Save a class name to search through
set class_name t1_http_request_limit_dglxx2
Save a search ID for the datagroup
set id [class startsearch $class_name]
Loop through the class row by row
while {[class anymore $class_name $id]}{
set element [class nextelement $class_name $id]
log local0. "\[class nextelement $class_name $id\]: $element"
Perform some operation against the current datagroup key and/or value
scan $element {%[^ ] %d/%d} a b c
log local0. "scanned $element: $a, $b, $c"
}
Clean up the search
class donesearch $class_name $id
This works for a single line or multiple line data group. I think the reason your original rule isn’t working as expected is that the name and value returned using class get against a single line data group is interpreted as a two element TCL list: {name} {value}, whereas a multiple line data group is interpreted as {name1 value1} {name2 value2}.
That does seem a bit buggy. If you are interested in finding out more about you could open a case with Support. If you do, can you reply with the case number so I can follow it?
The class startsearch option worked as expected though so you should have a workaround.