Forum Discussion
iRule(event) evaluation
Hi all,
I have some questions about iRule evaluations:
If an event is triggered but the traffic doesn't match any of the conditions, what will happen?
(e.g. what will the following iRule do if pool_fubar has more than 1 active member? And does it mean anything if the Virtual Server has a default pool configured or not?)
ltm rule /Common/rule_Fubar {
when HTTP_REQUEST {
if { [active_members pool_fubar] < 1 } {
HTTP::respond 200 content [ifile get sorry_file] "Content-Type" "text/html"
}
}
}
Thank you in advance,
Kai
- Jad_Tabbara__J1
Cirrostratus
Hi Kai,
If the pool_fubar has more than 1 active member it will not match this condition and depending on the VS configuration but if a default pool_member is assigned request will be load balanced to that particular pool.
If the VS has no pool member assigned and has no other irule that redirect traffic to a pool or a VS, requests are dropped or rejected...
Hope it helps
Regards
- Stanislas_Piro2
Cumulonimbus
Hi,
JTI provides the right response. This answer is to help you to optimize the code.
when working with virtual server, there is more and more virtual server distributing request to different pools based on hostname or URI. If you apply your code to a such virtual server, every content will display the maintenance page if pool_fubar is unavailable.
this code is more generic and can manage per request maintenance pool detection.
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1 } { HTTP::respond 200 content [ifile get sorry_file] "Content-Type" "text/html" } }
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