uni
Feb 04, 2014Altostratus
Parse datagroup values as a list
I have a datagroup which I am testing each element of:
foreach item [class names my-dg] {
if { [string match -nocase $item $teststring] } {
Unfortunately, if the datagroup elements have asterisks in them your config won't load if mcpd does a forceload or you are updating the software (even though you can enter these entries through the GUI, or through tmsh if they are escaped with a "\").
Anyway, I need to rewrite the rule, so I thought I'd just put all the names as values and have an arbitrary name such as a sequence number.
Can someone suggest a simple way to load the datagroup values as a list, so I can just loop through with a foreach, or some other efficient method of checking each value?