Forum Discussion
Kevin_Stewart
Mar 16, 2013Employee
Try this:
set e_fields [split [mcget {session.radius.last.attr.class}] "|"];
foreach field $e_fields { set hex [binary format H* [string range [string trim $fields] 2 end]];if { [string match -nocase "*ace*" $hex] } { return $hex } else { return "NO" }};
Three things:
1. The "contains" keyword is iRules-specific and doesn't work in VPE rules.
2. You needed H* for the binary format.
3. The hex value is stored with leading "0x" characters, but the binary format won't work with this, so [string range [string trim $fields] 2 end]] gets rid of them.