Forum Discussion
khalid_k_50814
Nimbostratus
Oct 21, 2009plink syntax question?
Hello,
I am new to the F5/BIG-IP world and have been struggling with a problem for sometime. I am writing a script which needs to SSH from a WINDOWS machine and remotely send command...
Sep 27, 2006
The URI will never be an empty string. If you submit https://server, the browser will send a get for "/" the same as it would if you requested https://server/.
So, in this case, your uri will never fall into the initial condition.
Also, you are setting the "uri" variable to the new path, but you aren't assigning it with the "HTTP::uri" command.
I'd suggest you throw in some logging statements to help yourself debug your logic. It's hard for us on our end to figure out exactly what your test environment is and most of the time logging will give you enough insight to figure it out for yourself.
when HTTP_REQUEST {
set uri [HTTP::uri]
log local0. "URI is : $uri"
if { $uri eq "" } {
log local0. "URI is empty - this will never happen!"
set uri "/path/path"
pool pool_app_http81
} elseif { $uri eq "/" } {
log local0. "URI is a slash"
set uri "/path/path"
pool pool_app_http81
} else { pool pool_app_http81 }
}
A few questions. In all of your conditions, you are specifying the pool pool_app_http81. Why not just do it once outside the if/else statements (or better yet, make that the default pool for the virtual). If you made the pool pool_app_http81 the default, then your rule would simplify to this
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } {
HTTP::uri "/path/path"
}
}
No temporary variables and a single string comparison.
If you don't want to specify a default pool, you could do it in one place:
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } {
HTTP::uri "/path/path"
}
pool pool_app_http81
}
Hope this helps...
-Joe