issue in irule and data group list

version is 11.0

I follow the “ltm_concepts_guide_v11_0” and try to test the data group list.

the sample is as below

when CLIENT_ACCEPTED {
if {[matchclass [IP::remote_addr] equals $::aol]}{
pool tw_proxy_slb_pool
  }
}

And i add my client subnet in default data group file “aol”

the test result is fail.

the error message is as below

TCL error: /Common/test_data_group - can’t read “::aol”: no such variable while executing “matchclass [IP::remote_addr] equals $::aol”

any idea?

can you try this?

if {[matchclass [IP::remote_addr] equals aol]}{

or

if {[class match -- [IP::remote_addr] equals aol]}{

Since you’re running v.11 you will want to use “class match” instead of “matchclass”, since the latter is a deprecated command.

Another thing worth mentioning is that as of version 9.4.4, you should no longer address datagroups using “$::” or “::”. Check out this thread as well:

https://devcentral.f5.com/Forums/tabid/53/aft/1176472/Default.aspx

-George

Hi RyanTseng,

Arie is correct. You should be using class match if you are in v11.x.x.

You will also need to drop the “$::” and/or “::” Global Variable Identifiers since they are no longer necessary as of v10.x.x. You can read more about that here: v.10 - A new iRules Namespace

Hope this helps.