On Jul 14, 2011, at 4:44 PM, Phil Mayers wrote:
On 14/07/11 15:24, Phil Mayers wrote:
I thought that the =~ regexp operator tried all attributes on the left-hand side; that is, I thought it looped through until it got first-match.
If it doesn't, then the idea of squeezing all the SoH data into a multiple instances of a single text attribute is going to need revisiting (or the "foreach" unlang operator will need backporting!)
Damn. You're right. It just looks at the first attribute.
Erm.... Hmm. That's a problem. It makes checking the attributes really painful. Blast. Sorry about that.
Maybe try this, which is a horrible hack:
if ("%{SoH-MS-Windows-Health-Status[*]}" =~ /s )/) { ... }
Or just checkout 3.x, then you can use: foreach SoH-MS-Windows-Health-Status { if("%{Foreach-Variable-0}" =~ /^antivirus (warn|error/i){ .... do stuff here break } } -Arran Arran Cudbard-Bell a.cudbardb@freeradius.org RADIUS - Half the complexity of Diameter