Forum Discussion
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 irul...
don't think i fully see the plan, are you suggesting something like below (i apologize for the bad pseudo code, dont have a f5 around now and removed a variable for keeping it small):
class vs1_class {
{
"uri1"
"45"
"vs1_pool"
}
}
class vs2_class {
{
"uri2"
"465"
"vs2_pool"
}
}
if {[class match [string tolower [HTTP::uri]] equals [virtual name]_class AND [class match [TCP::local_port]] equals [virtual name]_class} {
set pool some how
}
still have to figure something out for setting the pool.
is there a way to control the element from a data group / class you want to compare? because above code would search through the whole data group / class i believe.
something like this perhaps?
class vs1_class {
{
"uri" {"uri1"}
"port" {"45"}
"pool" {"pool_vs1"}
}
}
and then searching for uri and getting the value to compare or to set for pool? all depends on if the way to select a data group / class with [virtual name]_class works.
and it depends on having a different virtual server for every set variables right?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects