Forum Discussion

Sriram_129909's avatar
Sriram_129909
Icon for Nimbostratus rankNimbostratus
Nov 14, 2013

Conver Data Group List to static variables

I am looking to convert the global variables listed in Data Group List to a list of static variables. I am doing this as the virtual server associated with a few iRules are accessing them that would demote CMP. I am planning to create an iRule having only RULE_INIT that would set the static variables. Is there a good migration plan or if there is a better way to do this, can anyone suggest? Thanks!

 

  • I am doing this as the virtual server associated with a few iRules are accessing them that would demote CMP

     

    I'm not sure I understand this statement. If you're using [class ] syntax to query the data group, then that shouldn't be demoting CMP. I'd further add that if by chance it was demoting CMP, the act of accessing it RULE_INIT, if only to store the values somewhere else, would have the same effect.

     

    In any case, to enumerate the values in a data group, you can use the class get command:

     

    https://devcentral.f5.com/wiki/iRules.class.ashx

     

  • I have the following line in one of the iRule that the qkview data says should not use Global Variables.

    elseif { ([HTTP::path] ends_with ".asp") or [matchclass [string tolower [HTTP::path]] contains $::Domain_collapse_uri_list] } {

    I will change this line to use "class match" instead of matchclass. Is there any other change that I should do to this line? like not to use :: for the Variable?

  • Well, there's two things going on here. First, the matchclass command is deprecated in v10 and up, in favor of the new class match syntax. Second, since 9.4.4, you shouldn't use the $:: syntax to reference data groups. It may work in some versions, but it'd most definitely demote CMP.

     

  • Thanks. I read the same in F5 documentations also. Now, what I don't find is does this change to the iRule require a roboot?