Filtering accounting messages

liran kessel lirankessel at gmail.com
Sun Jul 14 22:07:38 CEST 2019


Hi,

Alan thanks for the explanation.
I understand what you proposed but this (my users) is a dynamic list that will grow constantly so the question is what would be the best way to keep it updated within the configuration?
As I said in the original mail , we are growing to over 150k unique calling-station-ids that around 80% should be recorded to the DB while 20% shouldn’t. 
Maybe storing the list in a file that I can reference in the suggested “if” statement?  
Or maybe there is way to cache the list in memory to speed it up even more? 

Thanks
Liran

> On 14 Jul 2019, at 21:27, Alan DeKok <aland at deployingradius.com> wrote:
> 
> On Jul 14, 2019, at 2:02 PM, liran kessel <lirankessel at gmail.com> wrote:
>> I am receiving accounting messages from the network and storing them to the radacct table. 
>> Currently in order to filter I have changed the INSERT/UPDATE commands with a where statement to only insert rows for subscribers I am managing.
> 
>  Hmm... that works, but isn't the most efficient.
> 
>> This is working fine but as my network grows it is creating a lot of overhead to execute SQL commands that don’t do anything and so I am trying to move the filtering to the FreeRADIUS code.
> 
>  That's good.
> 
>> I have added the preacct to the attr_filter file:
> 
>  I'm not sure why.  The attr_filter module will filter (i.e. delete) attributes in a packet.  It won't change how many times SQL is being called.
> 
>> However it seems that the filter is being ignored and all lines are inserted to the DB.
> 
>  Yes.
> 
>> Can you please assist in understanding why it isn’t filtering?
> 
>  Because filter attributes is not the same as skipping SQL.
> 
>> In addition if I have a list of about 100K subscribers that I do want to store their accounting data to the DB is there a way to manage this list without adding it 1 by 1 to the filter file?
> 
>  Yes.  Presumably there is some check you can do for your own users.  Then, do:
> 
> accounting {
> 	...
> 	if (my users) {
> 		sql
> 	}
> 	# else not my users, don't do SQL
> 	...
> }
> 
>  The only magic here is how to determine what are "my users".  Since that's local to your system, we can't help here.
> 
>  Alan DeKok.
> 
> 
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html




More information about the Freeradius-Users mailing list