Forum Discussion

Vince_Beltz_959's avatar
Vince_Beltz_959
Icon for Nimbostratus rankNimbostratus
Apr 15, 2009

Simple Question

I have an external integer data group containing a single numeric value. I want my iRule to read that value, and set the value of a variable equal to it. I've been looking at findclass and getfield, but only want that first (and only) value. Help?

 

3 Replies

  • Have you looked into lassign ( Click here)?

     

     

    I suppose you can do lassign against a findclass to get a variable assigned.

     

     

    hope this helps

     

    CB
  • It looks like the lassign command was added in TCL v8.5. F5 is using 8.4.x in all existing versions.

     

     

    You could use [lindex $::datagroup 0] to get the first (or only) element of the datagroup.

     

     

    Aaron
  • In 10.x+ you can use class element for this:

     

     

    http://devcentral.f5.com/wiki/iRules.class.ashx

     

     

    class element [< options >] < index > < class >

     

     

    Aaron