Need an Irule

What is an I rule for differentiating a traffic.

Requriment

If uri contains /xyz : it has to go to one of the member of the pool If URi contains /abc : It has to go to another member of the poolddd.d

Kindly provide an Irule Thanks Sachin M

You should really looking into creating a policy, assuming you have bigip 11.4 or better. Works a charm for our applications. Then you just create two pools and give them meaningful names. Will be much clearer to those that come behind you to support it.

Apply the policy to your virtual. Ideally you shouldnt apply a pool to your virtual b/c if that pool goes down it takes your virtual with it.

when HTTP_REQUEST {

if { ([string tolower  [HTTP::uri]] starts_with "/xyz") } {
    pool abc
} else {
    pool def

}

but I would recommend you to use a ltm policy for this ask

you can use LTM HTTP Policies to do that

basically HTTP Policies are a GUI version of implemented easy HTTP parsing that a irule would do

*Hi Thanks for the reply

I need a traffic to be flowed to same pool member not different.*

I have two pool members with same content inside.

thanks and Regards Sachin M

when HTTP_REQUEST {

if { ([string tolower  [HTTP::uri]] starts_with "/xyz") } {
    pool mypool member 1.2.3.4
} else {
    pool mypool member 1.2.3.4
}