how to account different table sql by time decision
hi guys i want to store accounting packet to different table sql with if time condition. like if (time > 1 am) and (time < 9 am) { store to acct2} else { store to acct1} i think the solution is using unlang language and put in radius conf. im not familiar with unlang language. i would appreciate if anybody here could help me. johan
Hi,
i want to store accounting packet to different table sql with if time condition. like if (time > 1 am) and (time < 9 am) { store to acct2} else { store to acct1}
i think the solution is using unlang language and put in radius conf. im not familiar with unlang language. i would appreciate if anybody here could help me.
yep...you've pretty miuch got it - just convert it to unlang and have the required other SQL instance configured eg in accounting { if (time logic here, based on regex or unlang and RADIUS attributes) { sql } else { othersql } } othersql being a named instance of the SQL module using a different table etc alan
if acct packet goes at first time , sql instance would be insert, and subsquent should be update. if have 2 table radacct, 1rst radacct for accounting for night hours and the others for work hours. how to make sure there are 2 insert operation in a session accounting ? Hi,
i want to store accounting packet to different table sql with if time condition. like if (time > 1 am) and (time < 9 am) { store to acct2} else { store to acct1}
i think the solution is using unlang language and put in radius conf. im not familiar with unlang language. i would appreciate if anybody here could help me.
yep...you've pretty miuch got it - just convert it to unlang and have the required other SQL instance configured eg in accounting { if (time logic here, based on regex or unlang and RADIUS attributes) { sql } else { othersql } } othersql being a named instance of the SQL module using a different table etc alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 7, 2015, at 10:25 AM, johan firdianto <johanfirdi@gmail.com> wrote:
if acct packet goes at first time , sql instance would be insert, and subsquent should be update. if have 2 table radacct, 1rst radacct for accounting for night hours and the others for work hours. how to make sure there are 2 insert operation in a session accounting ?
In 3.0.8 and later, all of this is handled automatically for you. The SQL module runs through a series of queries until one succeeds. The default configuration has the correct combination of insert / update to make this work. Alan DeKok.
participants (3)
-
A.L.M.Buxey@lboro.ac.uk -
Alan DeKok -
johan firdianto