find out if a datagroup exists

I’m inside an iRule and I want to find out if a particular datagroup exists before I call class match. How do I do that?

have you tried “class exists”?

class

Not yet. I’m going to give that a try. Thanks for the suggestion.

It works!

Check if the datagroup exists

if { [class exists [virtual name]] } { … use class match query

} else { … log error }

The check was important to us because we found out that if the datagroup was missing, the iRules terminates right on the class match statement.