Andrew_Galvin_2
Feb 14, 2006Nimbostratus
Help withcatch-all for iRule
Folks
I am hoping someone can provide some advise for this, I am relatively new to iRules. I have an iRule that checks HTTP::uri for various strings and directs traffic to a pool based on that. The complete iRule is at the bottom of this post. We have discovered that some applications are communicating using the weblogic t3 protocol rather than http. So for that traffic the rule is never matched and the traffic goes into a black hole. I would like a catch-all at the end of the rule that will send any traffic other than http to a default pool but I am unsure how to achieve this. I had hoped that placing this at the end of the iRule would provide a solution:
when CLIENT_DATA {
if { ([TCP::local_port] == 8020) } {
pool evo_3dns_pool
}
}
But it has been pointed out that this will intercept all traffic (even the http specified at the top of the iRule) and send everything to the default pool. Any thoughts on how I progress?
rule Evo_iRules {
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/nws" } {
log " [HTTP::uri] - using evo_news_pool"
pool evo_nws_pool
} else {
if { [HTTP::uri] starts_with "/wea" } {
pool evo_wea_pool
}
else {
if { [HTTP::uri] starts_with "/adt" } {
pool evo_adt_pool
}
else {
if { [HTTP::uri] starts_with "/alerts" } {
pool evo_alerts_pool
}
else {
if { [HTTP::uri] starts_with "/afl" } {
pool evo_afl_pool
}
else {
if { [HTTP::uri] starts_with "/alm" } {
pool evo_alm_pool
}
else {
if { [HTTP::uri] starts_with "/aqe" } {
pool evo_aqe_pool
}
else {
if { [HTTP::uri] starts_with "/bbr" } {
pool evo_bbr_pool
}
else {
if { [HTTP::uri] starts_with "/com" } {
pool evo_com_pool
}
else {
if { [HTTP::uri] starts_with "/crk" } {
pool evo_crk_pool
}
else {
if { [HTTP::uri] starts_with "/gme" } {
pool evo_gme_pool
}
else {
if { [HTTP::uri] starts_with "/mca" } {
pool evo_mca_pool
}
else {
if { [HTTP::uri] starts_with "/mus" } {
pool evo_mus_pool
}
else {
if { [HTTP::uri] starts_with "/pfs" } {
pool evo_pfs_pool
}
else {
if { [HTTP::uri] starts_with "/pic" } {
pool evo_pics_pool
}
else {
if { [HTTP::uri] starts_with "/rbg" } {
pool evo_rbg_pool
}
else {
if { [HTTP::uri] starts_with "/rlg" } {
pool evo_rlg_pool
}
else {
if { [HTTP::uri] starts_with "/run" } {
pool evo_run_pool
}
else {
if { [HTTP::uri] starts_with "/soc" } {
pool evo_soc_pool
}
else {
if { [HTTP::uri] starts_with "/spo" } {
pool evo_spo_pool
}
else {
if { [HTTP::uri] starts_with "/sta" } {
pool evo_sta_pool
}
else {
if { [HTTP::uri] starts_with "/swat" } {
pool evo_swat_pool
}
else {
if { [HTTP::uri] starts_with "/ton" } {
pool evo_ton_pool
}
else {
if { [HTTP::uri] starts_with "/vws" } {
pool evo_vws_pool
}
else {
pool evo_3dns_pool
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}