Forum Discussion
qqdixf5_74186
Nimbostratus
May 27, 2009v10 class feature
We are migrating our iRules to v10 and need to change the way we access datagroups. First, thank you for the detailed explanation about the new class feature(http://devcentral.f5.com/Default.aspx?tabi...
qqdixf5_74186
Nimbostratus
Jun 02, 2009Have a question on the new [class] commands.
My test datagroup contains elements like below.
{
{vip1_a 123.4.5.6}{}
{vip2_a 123.4.5.7}{}
{vip3_a 123.4.5.8}{}
{vip1_b 123.4.5.9}{}
}
Here is my little iRule to figure out how many vips are for "a" and for "b". I only care about the names of the elements in this case.
set vipsForA [class names -nocase myDataGroup *_a*]
set vipsForB [class names -nocase myDataGroup *_b*]
log local1. "vipsForA = $vipsForA" --- this gives me "{vip2_a 123.4.5.7} {vip1_a 123.4.5.6} {vip3_a 123.4.5.8}"
log local1. "vipsForB = $vipsForB" --- this gives me "vip1_b 123.4.5.9"
log local1. "size of vipsForA = [llength $vipsForA]" --- this gives me 3
log local1. "size of vipsForB = [llength $vipsForB]" --- this gives me 2
Should the last statement be 1 instead?
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
