Forum Discussion

4 Replies

  • Hi Mike,

     

     

    You can use [URI::path [virtual name]] in any non-RULE_INIT event to get the iRule's path and [URI::basename [virtual name]] to get the virtual server name without the path. This was from Opher Shachar:

     

     

    https://devcentral.f5.com/community/group/aft/2161361/asg/50

     

     

    Aaron
  • Thank you Aaron.

     

     

    What about RULE_INIT ? Is it possible to get partition name from RULE_INIT ?

     

     

     

  • The iRule isn't associated with a virtual server in RULE_INIT so you can't use [virtual name]. And I can't think of a way to get the full name of the iRule.

     

     

    Aaron
  • THi's avatar
    THi
    Icon for Nimbostratus rankNimbostratus

    You could try:

     [lindex [split [virtual name] /] 1]
    

    Split the full virtual server name into a list and then take the first element after initial null string:

     [virtual name] /THi/THi_test

     [lindex [split [virtual name] /] 1]   THi