Hope below example can help you:
if you match "aol" traffic is sent to aol_pool otherwise is sent to the default pool associated to the VS.
when HTTP_REQUEST {
# case sensitive
if { [HTTP::uri] contains "aol" } {
pool aol_pool
}
}
In below cases we can the default pool in the code.
when HTTP_REQUEST {
# case sensitive
if { [HTTP::uri] contains "aol" } {
pool aol_pool
} else {
pool all_pool
}
# case insensitive
if { [string tolower [HTTP::uri]] contains "aol" } {
pool aol_pool
} else {
pool all_pool
}
}
References:
https://clouddocs.f5.com/api/irules/contains.html
https://clouddocs.f5.com/api/irules/HTTP__uri.html