You can use the pool command with the Host header value in combination with the catch command to capture errors.
Here is an example that logs to /var/log/ltm:
when HTTP_REQUEST {
log local0. "client: [IP::client_addr] -> [HTTP::host][HTTP::uri]"
if { [catch { pool [HTTP::host]}] }{
log local0. "pool [HTTP::host] doesn't exist!"
pool default_pool
}
}
'pool [HTTP::host]' will specify the value of the Host header as the pool. If the pool doesn't exist, it will generate an error which 'catch' will catch and return true. If catch returns true, then the default pool will be used.
Aaron