Forum Discussion
Get current default pool name in an iRule?
First a few things. I know I am resurrecting an older thread, but I felt since the original question was never satisfied, I should toss in my two cents.
The OP asked for a way to track what the currently assigned pool is under the theory that they (or some iRule associated to this VS) changed it on the fly and wanted to know what it is now. That can be done rather simply by keeping track of the change in the first place when your iRule is making those decisions:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
set current_pool [LB::server pool]
}
when HTTP_REQUEST {
switch -glob [ string tolower [HTTP::uri]] {
"/images*" {
set current_pool pl_images
pool pl_images
}
"/reports*" {
set current_pool pl_reports
pool pl_reports
}
default { pool $default_pool }
}
}The simpler approach is to simply map out your actual changes ahead of time. In the case of URI pool changes, capture the default pool before you do any custom changes so you know the pool name to use when you want to 'revert' back to the default. It's the same as above but you simply don't care to track what your current selection was because each pass through HTTP_REQUEST will examine where the pool selection needs to go for the current request.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
