dynamically defining name of radacct and radpostauth table names

Alex Sharaz alex.sharaz at york.ac.uk
Tue Sep 23 17:12:56 CEST 2014


On 23 Sep 2014, at 15:40, Alan DeKok wrote:

> Alex Sharaz wrote:
>> Hi,
>> 
>> For quite some time now i've been using the sql_log module to write SQL statements into a file on each of my RADIUS servers which are processed by rad-sqlrelay. It works well but due to the number of records produced I do need to do some form of mysql table management. Rather than have 2 huge tables (radacct and radpostauth) I'd like to start using monthly tables. Would it be possible to dynamically generate a table name of the form radacct + "_" + "mth" + "yr"  e.g. radacct_sep14 or radacct_1014 from within the sql_logs so that when I generate my sql statements they'll be inserted into the appropriate "month" table?
> 
>  Yes.  That's why the queries can be edited.
> 
> http://wiki.freeradius.org/config/Run%20time%20variables
> 
>  Use %m to get the month of the request.  Use it in the table name, and
> it will be dynamically expanded.
> 
o.k. many thanks

>  Be sure to create the table for the next month BEFORE the month
> starts, otherwise the server won't be able to write to the table.
> 


Already done that

Rgds
Alex

>  Alan DeKok.
> 
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



More information about the Freeradius-Users mailing list