Forum Discussion

annielee_13548's avatar
annielee_13548
Icon for Nimbostratus rankNimbostratus
May 13, 2015

irules optimization

Hi, I am trying to optimize the irules below (to a for each loop, if possible) im modifying and need some programming help 🙂 if { ([HTTP::host] contains "env-1") || ([HTTP::host] contains "1.1....
  • nitass_89166's avatar
    May 13, 2015

    can you try something like this?

    when HTTP_REQUEST {
      switch -glob [HTTP::host] {
        "*env-1" -
        "1.1.1.1*" {
           Do something
        }
        "*env-2*" -
        "1.1.1.2*" {
           Do something
        }
        default {
           Do something
        }
      }
    }