For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Stefank's avatar
Stefank
Icon for Nimbostratus rankNimbostratus
Jul 10, 2019
Solved

Check via iRule if data group exists

Hello All,

I am new to iRules, hope you can help me out. Thank you in advance.

The use case is that I want to double-check on a specific data group availability, hence to check whether it exists or not. AFAIK the data group from iRule point of view is called classes, and I am aware about the catch command as well, so was wondering about something like the following, just not sure what command(s) to use in place of ???:

 

if {[catch {class ??? my_data_group_name}]} {

 # The class does not exist

} else {

 # The class exists

}

  • if { [class exists my_data_group_name] } {
        # do something
    } 

2 Replies

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus
    if { [class exists my_data_group_name] } {
        # do something
    }