Forum Discussion
darragh_19954
Nimbostratus
Nov 08, 2007How do I access BIG-IP "Data Group List" class as a list in an iRule?
We are defining a class using the "Data Group List" in the BIG-IP GUI.
From within an iRule, one typically matches against an element of this list with some code like:
if { [matchclass $value equals $::ClassList] } { ... }
However we require each member of this class/list to be a string-encoded record, not a single value to be compared.
So within the iRule, we want to gain access to the raw list of values in the class, so we can parse each value in a loop and action depending on its breakdown.
Does anyone know how to do this?
thanks
darragh
- You can use any of the TCL list commands (llength, lindex, etc) with a data group. For looping through a class called ClassList, you could do the following:
set count [llength $::ClassList] for {set i 0} {$i < $count} {incr i} { set val [lindex $::ClassList $i] log local0. "ClassList($i) : $val" }
foreach val $::ClassList { log local0. "ClassList Item : $val" }
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