I’m trying to make my life easier by having a single iRule that lookups the name of a data set from another data set and then do a matchclass against this returned name. Then do this for each row in the lookup data set… okay some code might help here, something like:
I have nearly 100 redirects to include. Some full site, some path and some specific files. Many of them apply to the same lists of domain names so i was hoping to beable to reuse these lists by having multiple data sets.
Try enclosing the lookup_redirects entries in curly braces, not quotes. By using quotes, the interpreter is expanding the list contents so the resulting list is this:
When using braces the variables are not expanded but stored by reference.
class lookup_redirects {
{$::domainlist_1 http://www.whatever.com/redirect-to-here}
{$::domainlist_2 http://www.whatever.com/redirect-to-there}
}
I believe this will work, let me know if not.
If all else fails, use log statements everywhere. If you would have logged the value for $row on each iteration of the foreach loop you would have seen that it wasn’t what you expected. Also log all variables. This would have told you something was up right away.