Thanks for your reply Hoolio,
Looks like this will almost work for us, However we need it to parse the entire character set after the slash instead of just the first letter.
This is the line I believe needs to be modified:
Parse first character after the leading slash
set pool_string [string toupper [string range [HTTP::path] 1 1]]
I am not sure what needs to be changed? Can you point me in the right direction on this?
I posted the entire irule below.
Thanks
Parse the URI to determine which pool to send requests to.
The pool string should be the second character in the URI.
Example: The pool for URI '/A/path/to/file.ext' is pool_A
Change "default_pool" to the pool which should be used if the parsed pool name doesn't exist.
when HTTP_REQUEST {
Check if requested path is at least two characters long
if {[string length [HTTP::path]] > 1}{
Parse first character after the leading slash
set pool_string [string toupper [string range [HTTP::path] 1 1]]
Try to set the pool based on the URI. If the pool name doesn't exist, catch the error.
if { [catch {pool pool_${pool_string}}]}{
The pool parsed from the URI didn't exist
log local0. "Error assigning pool to pool_${pool_string}"
Assign a default pool for this request
pool default_pool
}
}
}