Hi all,
I need to help me for verification my irule if it is correct? when I receive anyway URI I need to verify the pool_YYYY the stats, if went ok, he goes to pool_XXXX. Else he changes the URI (*) and redirect to pool_ZZZZZZZ with the /test/ URI.
My doubt is if can I put URI the “*” parameter in the HTTP::uri?
when HTTP_REQUEST { [HTTP::uri] "/" { if { [active_members - list pool_YYYY] > 0 } { pool pool_XXXX } else { HTTP::uri [string map { / /test/ } [HTTP::uri]] pool pool_ZZZZZZZ } }
HI Vitor,
corrected some portions…
when HTTP_REQUEST {
if { [active_members pool_YYYY] > 0 } then {
pool pool_XXXX
} else {
HTTP::uri "/test[HTTP::uri]"
pool pool_ZZZZZZZ
}
}
Note1: Theoption ofcommand is not required to count the numbers of active pool members. The -list option would deliver a string containing the IPs and Ports of every available pool members, which produces unnecessary overhead.
-list
[active_members -list pool_YYYY]
Note2: If you want to ad a trailing string to theyou could easily substitute the new string, based on the new trailing string and the old value (aka.).
[HTTP::uri]
"/test[HTTP::uri]"
Cheers, Kai