I need to get data out of the Cisco-AVPair attributes; based on http://lists.freeradius.org/pipermail/freeradius-users/2014-May/072096.html I'm trying this: accounting { # make cisco attributes accessible foreach Cisco-AVPair { if ("%{Foreach-Variable-0}" =~ /^client-mac-address=(.+)/ ) { update control { client-mac-address = "%{1}" } } elsif ("%{Foreach-Variable-0}" =~ /^connect-progress=(.+)/ ) { update control { connect-progress = "%{1}" } } elsif ("%{Foreach-Variable-0}" =~ /^disc-cause-ext=(.+)/ ) { update control { disc-cause-ext = "%{1}" } } elsif ("%{Foreach-Variable-0}" =~ /^nas-rx-speed=(.+)/ ) { update control { nas-rx-speed = "%{1}" } } elsif ("%{Foreach-Variable-0}" =~ /^nas-tx-speed=(.+)/ ) { update control { nas-tx-speed = "%{1}" } } } ... When I try to start radius, however, I get: /etc/raddb/sites-enabled/peak[398] Unexpected text elsif ("%{Foreach-Variable-0}" =~ /^connect-progress=(.+)/ ) {. See "man unlang" Errors reading or parsing /etc/raddb/radiusd.conf It looks correct from my reading of "man unlang" though...