Forum Discussion
F_Ducloux_29246
Nimbostratus
Aug 04, 2008iRule help request
Hi Guys, I'm very new at this and I just joined a company that is using F5 BigIPs and i got asked to investigate if I could write a new rule to do this:
I have several virtual servers c...
Aug 04, 2008
If you are always triggering off of the second part of the virtual and the mapping is always to apache1."field 2".ee.com, then you can use getfield to extract that value and then dynamically build the pool name
when HTTP_REQUEST {
set token [getfield [HTTP::host] "." 2]
pool "apache1.$token.ee.com"
}
You might want to throw in some error validation to make sure that your generated pool name exists. If it does not, then the iRule will terminate and the connection will be broke.
when HTTP_REQUEST {
set token [getfield [HTTP::host] "." 2]
if { [catch { pool "apache1.$token.ee.com" } ] } {
log local0. "Error using pool apache1.$token.ee.com"
} else {
do some error handling in here.
}
}
If there isn't a one-to-one mapping, then you'll likely need to go with the findclass/matchclass option of building a lookup table.
Hope this helps...
-Joe
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
