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. 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. Alan DeKok.