Forum Discussion
Kai_Wilke
Jan 20, 2016MVP
Hi Wallst32,
if you have conflicting names for /clientxyz*, then you have to use the more accurate condition of /clientxyz.
But keep in mind that the page may request other content right after (e.g. CSS, JScript, grafics, etc.). So you may need to forward some additional [HTTP::uri]'s to the [pool pool.1]...
The logging part is quite easy to handle. You can basically put every readable iRule command directly into the log statement..
when HTTP_REQUEST {
log -noname local0.debug "Client = [IP::client_addr] has requested the URI = [HTTP::uri]"
switch -glob -- [string tolower [HTTP::uri]] {
"/clientxyz" {
log -noname local0.debug "URI = [HTTP::uri] is getting forwarded to pool.1"
pool pool.1
}
default {
log -noname local0.debug "URI = [HTTP::uri] is getting forwarded to pool.2"
pool pool.2
}
}
}
Note: I've changed your code to ignore the case using a [string tolower] command and included an -- to explicitly mark the end of the -option section. Both changes would make the [switch] condition more robust...
Cheers, Kai