On Tue, Dec 21, 2010 at 11:26 AM, Alan DeKok <aland@deployingradius.com> wrote:
Juri Glaß wrote:
I would like to write the Event-Timestamp from Accounting Start/Stop messages to my MySQL database instead of the server side time.
I tried to configure the dialup.conf, but it doesn't work properly.
I replaced %S with %{Event-Timestamp}, the result is "0000-00-00 00:00:00" in the database, the log file says : expand: UPDATE radacct SET acctstoptime = '%{Event-Timestamp}', ** snip ** -> UPDATE radacct SET acctstoptime = 'Dec 21 2010 10:02:30 CET' ** snip **
i.e. the Event-Timestamp is not in an SQL format. That's why the %S variable exists.
When I use something like DATE_FORMAT(date,format) from MySQL, the format string is somehow expanded. FROM_UNIXTIME isn't working either.
I understand that unix timestamps are printed as strings like 'Dec 21 2010 10:02:30 CET', but only for logging or for the sql statements too?
For everything, unfortunately. They cannot currently be printed as 32-bit integers. Maybe in 2.1.11.
2.1.10 allows you to use "{%Event-Timestamp#}" to get date type attributes printed in numeric format. It doesn't seem to be documented, but its in the code. Eddie