Forum Discussion

Srinivasan_G_31's avatar
Srinivasan_G_31
Icon for Nimbostratus rankNimbostratus
Oct 25, 2012

iRule help

Hi,

 

I want an iRule which can match a specific URI on an incoming http request and redirect traffic to a specific pool member of a pool. Please help.

 

Srini

 

 

17 Replies

  • OK, so how do you want to route to the pools? Using which digit in the URI? Or all of them? Are there 10 possible outcomes or 10,000?
  • I want to match the digits (preferably with a syntax matching anything from 0 to 9) and want to route it to a specific pool member inside a pool.

     

  • Answer for now is YES but i am looking from the developer on a finite set of node IDs that can be matched.
  • If you want to specify a particular pool member for requests which have a URI that contains four digits you could try something like this (1.1.1.1:80 being the special pool member of the VS default pool):

    
    when HTTP_REQUEST {
    switch -glob [HTTP::path] {
    "*[0-9][0-9][0-9][0-9]*" { pool [LB::server pool] member 1.1.1.1 80 }
    default { pool [LB::server pool] }
    }
    }
    

    Aaron
  • Thanks Aaron. A general query though. I already have an iRule applied to a particular VS. How the system treates the second iRule on the same VS? Are the lookups performed on both iRules simultaneously?

     

  • Answered here:

     

    https://devcentral.f5.com/internal-forums/aft/2164806

     

     

    Aaron