Thanks for making me understand the iRule execution process, Aaron. The issue got resolved. I had to make a change in your iRule to get it working.
Here are the logs before I made those changes to your iRule -
Aug 26 11:41:42 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1252: New GET request to abc.com/timesheets
Aug 26 11:41:44 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1253: Using timesheets_http_pool
Aug 26 11:41:42 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1252: Matched /timesheets check
Aug 26 11:41:42 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1252: Rewriting path to /GroupServer/en
Aug 26 11:41:44 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1253: New GET request to abc.com/GroupServer/en/
Aug 26 11:41:44 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1253: Using default_http_pool
Aug 26 11:42:31 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1254: New GET request to abc.com/
Aug 26 11:42:31 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1254: Using default_http_pool
Aug 26 11:42:31 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1254: Rewriting path to /primaveraweb
Aug 26 11:42:32 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1254: New GET request to abc.com/primaveraweb/
Aug 26 11:42:32 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1254: Using default_http_pool
Aug 26 11:42:36 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1254: New GET request to abc.com/primaveraweb/action/login
Aug 26 11:42:36 tmm tmm[2091]: Rule abc_com_rule : 141.144.152.122:1254: Using default_http_pool
Notice that after the first rewrite (line 4), the Big-IP made the client to send abc.com/GroupServer/en/. Again the Big-IP checks the iRule from the beginning. This time the condition 'if {[HTTP::path] starts_with "/timesheets"}' fails and hence it was choosing the default_http_pool.
I made the following change and that took care of it -
if {[HTTP::path] starts_with "/timesheets" or [HTTP::path] starts_with "/GroupServer"}{
log local0. "[IP::client_addr]:[TCP::client_port]: Matched /timesheets check"
pool timesheets_http_pool
log local0. "[IP::client_addr]:[TCP::client_port]: Using timesheets_http_pool"
Rewrite path if path is exactly /timesheets
if {[HTTP::path] eq "/timesheets"}{
Rewrite path
HTTP::path "/GroupServer/en"
log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting path to /GroupServer/en"
}
}
Thanks again for your valuable input.
Regards,
Shridhar