Forum Discussion
hooleylist
Aug 30, 2011Cirrostratus
Hi Tom,
The minimal change you have to make is to remove the $:: prefix from the datagroup names in the iRules. If you do this you can continue to use findclass and/or matchclass in v10 or v11 as you did in v9.
To gain performance you should ideally change matchclass and findclass to the corresponding class sub-commands. You can also take advantage of the new name=value pairs available in 10.1+ using the class command with the -value option. This last option would require changing your string datagroups from a "key value" space separated format to the new name=value format:
class string_name_value_class {
{
"key1" { "value1" }
"key2" { "value2" }
}
}
class address_name_value_class {
{
host 1.1.1.1 { "value1" }
network 1.1.2.0/24 { "value2" }
}
}
Sample iRule which gets the value for a string datagroup entry and an address datagroup entry
when RULE_INIT {
set value [class match -value "key1" equals string_name_value_class]
log local0. "Looked up key1 and found $value"
set value [class match -value 1.1.2.25 equals address_name_value_class]
log local0. "Looked up 1.1.2.25 and found $value"
}
Log output:
Looked up key1 and found value1
Looked up 1.1.2.25 and found value2
Aaron