Forum Discussion

Reginald_Sible1's avatar
Reginald_Sible1
Icon for Nimbostratus rankNimbostratus
Aug 23, 2017

Netscaler to F5 Content switch iRule conversion

Netscaler to F5 iRule conversion,

 

Can someone assist with this iRule conversion.

 

Policy1: HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).CONTAINS("/poc") directs to server 10.5.80.29 Policy2: HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).CONTAINS("/mst") || HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).CONTAINS("/mdrval") directs to server 10.5.80.31 Policy3: HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).CONTAINS("/tst" directs to server 10.5.80.30 Policy4: HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).CONTAINS("/sup") directs to server 10.161.96.89

 

  • You can use multiple if-statements within HTTP_REQUEST event:

    if { ([HTTP::uri] contains "/poc") } {
    pool HTTP_pool member 10.5.80.29 80
    } elseif { ([HTTP::uri] contains "/tst") } {
    pool HTTP_pool member 10.5.80.30 80
    

    You can also use an data group with URI:=Pool-Name. Each pool name is unique and contains the relevant members and then use something like:

    when HTTP_REQUEST {
    set POOL [class match -value [HTTP::uri] contains CLASS_URI_POOL]
    pool $POOL
    }