Forum Discussion

vallesm77_95699's avatar
vallesm77_95699
Icon for Nimbostratus rankNimbostratus
Feb 14, 2012

Irule v9 --> v11

Hello,

 

 

On BigIP V9 I have an Irule

 

 

An extract :

 

 

when CLIENT_ACCEPTED {

 

set DefaultValue "::DefaultValue[virtual name]"

 

 

if { [class exists $DefaultValue]} {

 

set myRedirectRow [findclass "ForbiddenUrl" [set $DefaultValue] " "]

 

if { $myRedirectRow ne "" } {

 

set myRedirectMethod [getfield $myRedirectRow " " 1]

 

 

....

 

 

 

But with V11, I think that i have a problem with the syntax :

 

 

set DefaultValue "::DefaultValue[virtual name]"

 

 

Because [virtual name] return /Common/

 

On V9 [virtual name] returne only

 

 

Do you have an idea ?

 

 

Thanks

 

  • Hi vallesm77,

     

     

    Check this related thread for some options to parse the virtual name from the path:

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2158968/showtab/groupforums/Default.aspx2234683

     

     

    You might also consider updating your iRule to use the full virtual name as the data group should have a folder as well.

     

     

    Also, if you're running on a CMP capable platform you should try to avoid using global variables like "$::defaultValue". You can set $static::defaultValue in RULE_INIT instead:

     

     

    http://devcentral.f5.com/wiki/iRules.static.ashx

     

     

    Aaron