Forum Discussion

William_Them_99's avatar
William_Them_99
Icon for Nimbostratus rankNimbostratus
Jun 03, 2005

Problems declaring a class datagroup

I am trying to declare a datagroup as a class within my iRule. I am not having any luck, even with an example class I found in a post.

 

 

I tried doing this:

 

 

class images {

 

".gif"

 

".jpg"

 

}

 

 

when HTTP_REQUEST {

 

....

 

}

 

 

 

and I get this error when I try to save the iRule:

 

 

line 9: [undefined procedure: class] [class images {

 

".gif"

 

".jpg"

 

 

Can anyone help?

 

 

Thanks.

2 Replies

  • This is a common mistake. When posting iRules, some users will include the entire code from the /config/bigip.conf file. This is the configuration that is generated by the gui. Some users are more comfortable working in this environment.

     

     

    In the GUI, classes are not defined in the iRule itself but instead by the "Data Group List" tab under the "Local Traffic/iRules" page. Create your class (a.k.a. Data Group List) over there first and then reference it in your iRule.

     

     

    Once you create your Data Group List, you can look in the /config/bigip.conf file and you'll see a class defined for the Data Group List you created.

     

     

    -Joe

     

  • No problem. Let us know if you have any other iRules or iControl related questions and we'll do our best to give you some assistence.

     

     

    -Joe