HTTP::uri rewrite and pool selection via iRule

Hello,

I am working on an iRule and would like to know if I am on the right track.

My requirement is this.

1 VIP:

vip1.com

3 Pools:

A_8483

B_8484

C_8485

2 nodes:

I have application on 3 different ports 8483, 8484, 8485 on both of the nodes. I want all my a http requests to come through one VIP and with a uri rewrite I want the traffic to go to certain pools. Here is my code.

when HTTP_REQUEST {

switch -glob [string tolower [HTTP::uri]] {

“/A/xxStatus/command*” {

HTTP::uri “/xxStatus/command*”{

pool A_8483

}

}

}

{

“/A/xxStatus/export”{

HTTP::uri “/xxStatus/export”{

pool A_8483

}

}

}

{

“/A/xxStatus/ExportB”{

HTTP::uri “/xxStatus/ExportB”{

pool A_8483

}

}

}

{

“/B/xxStatus/command*” {

HTTP::uri “/xxStatus/command*”{

pool B_8484

}

}

}

{

“/B/xxStatus/export”{

HTTP::uri “/xxStatus/export”{

pool B_8484

}

}

}

{

“/B/xxStatus/ExportB”{

HTTP::uri “/xxStatus/ExportB”{

pool B_8484

}

}

}

{

“/C/xxStatus/command*” {

HCTP::uri “/xxStatus/command*”{

pool C_8485

}

}

}

{

“/C/xxStatus/export”{

HTTP::uri “/xxStatus/export”{

pool C_8485

}

}

}

{

“/C/xxStatus/ExportB”{

HTTP::uri “/xxStatus/ExportB”{

pool C_8485

}

}

}

}

Any thoughts on this? Mainly I want to know if it is even possible to do a URI rewrite and a pool selection with the iRule.