Forum Discussion
gerald_wegener_
Nimbostratus
Aug 23, 2006Method for reading variables needed
I looking for a way to read varibles (integers) into an iRule. The variables must be able to be modified on the fly via the command line. So far the best I can come up with is to use data group lists defined as integers for each variable. Each DGL has a single integer entry in it (e.g. 5). I can modify these on the fly via the command line using the bigpipe command.
My question is if a DGList has a single integet in it can it be read directly into a variable? For example if I have a DGList named "percent" with a single value of integer 5 in it is there someway I can read that into a variable e.g.
set a [matchclass::percent] (so I get the value of a = 5)
How can I do this? Can I use DGLists or is the a better/simplier way to do it?
Thank you.
- Data Groups can be treated as TCL lists, so you can use all of the TCL list commands to extract values from them. If you have a data group and you want to extract the first element, you can use the lindex command:
set a [lindex $::percent 0]
- unRuleY_95363Historic F5 AccountIf the list only has one element, you don't even need to use lindex. In that case, you can just use $::percent
- gerald_wegener_
Nimbostratus
Thanks for the heads up. - That's probably your best bet at this point. We are working at alternate ways to query external data but at this point data groups are your only option (outside of internal rule data).
- unRuleY_95363Historic F5 AccountI can't think of a better way at the moment...
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