Forum Discussion

t-roy's avatar
Icon for Nimbostratus rankNimbostratus
Jun 07, 2012

matching local port AND a variable in one line

I have an iRule built and it is currently looking at the local port, if 443 it appends "-HTTPS" to the pool name variable, but I am concerned that someone might put a POOL-HTTPS name in my data-group, so I would like to only append it if the Pool does not currently end in HTTPS, when I add the && statement I am getting errors, though:




if {[[TCP::local_port] equals 443] && !($pool_select ends_with “HTTPS”)}{


append pool_select "-HTTPS"


2 Replies

  • Odds are it's the brackets around the first equals comparison. That is trying to turn the equals comparison into a command that doesn't exist.

    This should work

    if { ([TCP::local_port] equals 443) && !($pool_select ends_with "HTTPS") } {
      append pool_select "-HTTPS"