boneyard
Mar 07, 2012MVP
looking to optimize / generalize irule
i have an irule which selects a pool based on several known items (think: uri, client ip, port). i have many of these sets, so some strings and a poolname. currently this is all hard coded in the irule, which means many variables.
looking ahead this isnt a nice way to handle things and only becomes worse with every addition. id like to do this better and think data groups / classes can be a solution. (if there is an other one im open to it for sure).
i was thinking about having a data group per set of strings and pool. but that would mean having all the data group names hard coded in the irule right? is there some way to work around this? one thing i thought might work is having a "super" data group containing the names of the other data groups, would that work?
to look at it in another way: if i would do something like this in an other language i would use an array filled with arrays, but im not sure how to do it in an irule.