Delete one value of multiple attribute(Class)

Okis Chuang okischuang at outlook.com
Tue Jul 16 09:10:30 CEST 2013


Dear all,

 

I want to delete a specific AVP which could be one of multiple value
attribute, such as *Class*.

Suppose I have three Class value: Class 1, Class 2, Class 3. Then I want to
remove Class 2 if its value matches the regex in the "pre-proxy section".

 

I've tried some unlang below but it did nothing on Class.

 

If("%{proxy-request:Class[*]}" =~ /(some regex here)/) {

        

        update proxy-request {

                

                Class -= "%{1}"

 

        }

 

}

 

I'm sure the if condition is *TRUE* and the %{1} expanding value is also
what I'm going to delete.

Otherwise, proxy-request returned *updated*.

 

However, Class 2 is still there.

 

Btw, I think attr_filter may do very few help to me, since it cannot work by
operator "-~" , at least in my experiences.

I've spend some time searching about how to delete or remove attribute in
mailing list. There is no one fit my situation since they almost can be
solved by module "attr_filter".

 

So does any master hand can kindly teach me how to achieve this goal?

 

Thanks a lot.

 

Okis.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20130716/41dc5d58/attachment.html>


More information about the Freeradius-Users mailing list