Forum Discussion

C_D_18583's avatar
C_D_18583
Icon for Nimbostratus rankNimbostratus
Oct 19, 2005

Syntax Translation from v4.1 to V9.1

Here is part of a code from V4.1

 

 

vendors is defined as a data set. I need a translation

 

from v4.1 to v9.1 on the IF statement

 

 

Code:

 

elseif ($uri starts_with "/Data/uplink" {

 

if (client_addr == one of vendors) {

 

pool P_DATA

 

}

 

else {discard}

 

}

 

Thanks in advance.

3 Replies

  • This should get you going

    ...
    } elseif { [HTTP::uri] starts_with "/Data/uplink" } {
      if { [matchclass [IP::client_addr] equals $::vendors] > 0 } {
        pool P_DATA
      } else {
        discard
      }
    }

    You might want to convert the elseif line to

    } elseif { [string tolower [HTTP::uri]] starts_with "/data/uplink" } {

    if you want a case independent match.

    Also, If your vendors list is an address list containing netmasks (and you have not upgraded to BIG-IP v9.0.3 or higher), you might want to check out this thread as well for a known issue with matchclass and comparing network addresses with netmasks.

    http://devcentral.f5.com/Default.aspx?tabid=28&view=topic&forumid=5&postid=1235

    Click here

    -Joe