Forum Discussion

Brian_69413's avatar
Brian_69413
Icon for Nimbostratus rankNimbostratus
Nov 27, 2007

logic based on Virtual Server

I have an iRule that is applied to multiple Virtual Servers but should take different actions depending on which one triggers the rule. Is there a way to to perform logic based on Virtual Server?

 

 

Thanks!
  • You could use a switch:

    
    switch [virtual name] {
          "vip1" {
            do stuff here ....
          }
          "vip2" -
          "vip3" {
            do different stuff here ....
          }"
          default {
            do default stuff here ....
          }
    }
  • Perfect, so [virtual name] contains the name of the Virtual Server being used?
  • Yep...Here's the wiki page: Click here

     

     

    Note the version specific lanaguage on this command. It looks like you may only want [virtual]