Linelog Event-Timestamp format
Hi, Im using linelog module and trying to generate a CSV file with the attribute "Event-Timestamp" with a custom format. The problem is that the module convert the value to a specific human readable format: Accounting-Request { Start = "%{Acct-Status-Type},%{Event- Timestamp},%{NAS-IP-Address},%{Framed-IP-Address},%{Called- Station-Id},%{Calling-Station-Id},%{Acct-Session-Id}" with that configuration I get: Start, Sep 10 2016 16:07:48,1.1.1.1,2.2.2.2,test.test,23354566767, 36u0qqarui9vlszx Is there a way to tell the module a required format for the date? Thanks.
On Sep 23, 2016, at 10:35 AM, rocky marciano <cartelluminoso@gmail.com> wrote:
Im using linelog module and trying to generate a CSV file with the attribute "Event-Timestamp" with a custom format. The problem is that the module convert the value to a specific human readable format:
Accounting-Request { Start = "%{Acct-Status-Type},%{Event- Timestamp},%{NAS-IP-Address},%{Framed-IP-Address},%{Called- Station-Id},%{Calling-Station-Id},%{Acct-Session-Id}"
with that configuration I get:
Start, Sep 10 2016 16:07:48,1.1.1.1,2.2.2.2,test.test,23354566767, 36u0qqarui9vlszx
Is there a way to tell the module a required format for the date?
Use %{integer:Event-Timestamp} to get the integer value. Alan DeKok.
Alan, I've tried that yet, and gives me the date in a timestamp format. I was wondering if there is a way to configure linelog to give me the date with this format: "09.10.2016 16:07:48" instead of what im getting "Sep 10 2016 16:07:48"? Thanks, On Fri, Sep 23, 2016 at 11:40 AM, Alan DeKok <aland@deployingradius.com> wrote:
On Sep 23, 2016, at 10:35 AM, rocky marciano <cartelluminoso@gmail.com> wrote:
Im using linelog module and trying to generate a CSV file with the attribute "Event-Timestamp" with a custom format. The problem is that the module convert the value to a specific human readable format:
Accounting-Request { Start = "%{Acct-Status-Type},%{Event- Timestamp},%{NAS-IP-Address},%{Framed-IP-Address},%{Called- Station-Id},%{Calling-Station-Id},%{Acct-Session-Id}"
with that configuration I get:
Start, Sep 10 2016 16:07:48,1.1.1.1,2.2.2.2,test.test,23354566767, 36u0qqarui9vlszx
Is there a way to tell the module a required format for the date?
Use %{integer:Event-Timestamp} to get the integer value.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
On Sep 23, 2016, at 10:47 AM, rocky marciano <cartelluminoso@gmail.com> wrote:
I've tried that yet, and gives me the date in a timestamp format.
No, it doesn't. Either the code works, and gives you the integer date. Or, it complaints that "%{integer}" isn't supported. Which version are you running? Did you restart the server after making the configuration change? Alan DeKok.
Alan, Im using 3.0.11 version. You are right, it gives me the integer value of the attribute, in my case the NAS sends a timestamp in attribute "Event-Timestamp" so when the linelog module dump that attribute to the CSV as an integer the value corresponds to the timestamp value. What im trying to do is to convert the timestamp in the "Event-Timestamp" attribute that the NAS sends to a specific human readable format in the CSV file. By default, when i configure %{Event-Timestamp} in linelog it dumps in the CSV the time with this format "Sep 10 2016 16:07:48", when i configure in linelog %{integer:Event-Timestamp} it dumps in the CSV the time as a integer, is there a way to tell linelog to dump in the CSV file the time with this format "09.10.2016 16:07:48"?? Thanks. On Fri, Sep 23, 2016 at 11:54 AM, Alan DeKok <aland@deployingradius.com> wrote:
On Sep 23, 2016, at 10:47 AM, rocky marciano <cartelluminoso@gmail.com> wrote:
I've tried that yet, and gives me the date in a timestamp format.
No, it doesn't.
Either the code works, and gives you the integer date. Or, it complaints that "%{integer}" isn't supported.
Which version are you running?
Did you restart the server after making the configuration change?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
Try the exec module : "date" in this you will date utility get whatever format you want. You have to make changes in exec module also to run it On Friday 23 September 2016, rocky marciano <cartelluminoso@gmail.com> wrote:
Alan,
Im using 3.0.11 version. You are right, it gives me the integer value of the attribute, in my case the NAS sends a timestamp in attribute "Event-Timestamp" so when the linelog module dump that attribute to the CSV as an integer the value corresponds to the timestamp value.
What im trying to do is to convert the timestamp in the "Event-Timestamp" attribute that the NAS sends to a specific human readable format in the CSV file. By default, when i configure %{Event-Timestamp} in linelog it dumps in the CSV the time with this format "Sep 10 2016 16:07:48", when i configure in linelog %{integer:Event-Timestamp} it dumps in the CSV the time as a integer, is there a way to tell linelog to dump in the CSV file the time with this format "09.10.2016 16:07:48"??
Thanks.
On Fri, Sep 23, 2016 at 11:54 AM, Alan DeKok <aland@deployingradius.com <javascript:;>> wrote:
On Sep 23, 2016, at 10:47 AM, rocky marciano <cartelluminoso@gmail.com <javascript:;>> wrote:
I've tried that yet, and gives me the date in a timestamp format.
No, it doesn't.
Either the code works, and gives you the integer date. Or, it complaints that "%{integer}" isn't supported.
Which version are you running?
Did you restart the server after making the configuration change?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
-- BR, Anirudh Malhotra Mail: 8zero2.in@gmail.com Facebook: www.facebook.com/8zero2 Twitter: @8zero2_in Blog: blog.8zero2.in
Alan, Im using 3.0.11 version. You are right, it gives me the integer value of the attribute, in my case the NAS sends a unix timestamp in attribute "Event-Timestamp" so when the linelog module dump that attribute to the CSV as an integer the value corresponds to the unix timestamp value. What im trying to do is to convert the unix timestamp in the "Event-Timestamp" attribute that the NAS sends to a specific human readable format in the CSV file. By default, when i configure %{Event-Timestamp} in linelog it dumps in the CSV the time with this format "Sep 10 2016 16:07:48", when i configure in linelog %{integer:Event-Timestamp} it dumps in the CSV the time as a integer, is there a way to tell linelog to dump in the CSV file the time with this format "09.10.2016 16:07:48"?? Thanks. On Fri, Sep 23, 2016 at 1:00 PM, rocky marciano <cartelluminoso@gmail.com> wrote:
Alan,
Im using 3.0.11 version. You are right, it gives me the integer value of the attribute, in my case the NAS sends a timestamp in attribute "Event-Timestamp" so when the linelog module dump that attribute to the CSV as an integer the value corresponds to the timestamp value.
What im trying to do is to convert the timestamp in the "Event-Timestamp" attribute that the NAS sends to a specific human readable format in the CSV file. By default, when i configure %{Event-Timestamp} in linelog it dumps in the CSV the time with this format "Sep 10 2016 16:07:48", when i configure in linelog %{integer:Event-Timestamp} it dumps in the CSV the time as a integer, is there a way to tell linelog to dump in the CSV file the time with this format "09.10.2016 16:07:48"??
Thanks.
On Fri, Sep 23, 2016 at 11:54 AM, Alan DeKok <aland@deployingradius.com> wrote:
On Sep 23, 2016, at 10:47 AM, rocky marciano <cartelluminoso@gmail.com> wrote:
I've tried that yet, and gives me the date in a timestamp format.
No, it doesn't.
Either the code works, and gives you the integer date. Or, it complaints that "%{integer}" isn't supported.
Which version are you running?
Did you restart the server after making the configuration change?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list /users.html
On Sep 23, 2016, at 12:00 PM, rocky marciano <cartelluminoso@gmail.com> wrote:
What im trying to do is to convert the timestamp in the "Event-Timestamp" attribute that the NAS sends to a specific human readable format in the CSV file. By default, when i configure %{Event-Timestamp} in linelog it dumps in the CSV the time with this format "Sep 10 2016 16:07:48", when i configure in linelog %{integer:Event-Timestamp} it dumps in the CSV the time as a integer, is there a way to tell linelog to dump in the CSV file the time with this format "09.10.2016 16:07:48"??
In v3.0: %{date:Event-Timestamp} Enable it via: $ cd raddb/mods-enabled $ ln -s ../mods-available/date And edit raddb/mods-available/date to get the format you want. Alan DeKok.
Thanks Alan! Its just what i was looking for! On Fri, Sep 23, 2016 at 3:02 PM, Alan DeKok <aland@deployingradius.com> wrote:
On Sep 23, 2016, at 12:00 PM, rocky marciano <cartelluminoso@gmail.com> wrote:
What im trying to do is to convert the timestamp in the "Event-Timestamp" attribute that the NAS sends to a specific human readable format in the CSV file. By default, when i configure %{Event-Timestamp} in linelog it dumps in the CSV the time with this format "Sep 10 2016 16:07:48", when i configure in linelog %{integer:Event-Timestamp} it dumps in the CSV the time as a integer, is there a way to tell linelog to dump in the CSV file the time with this format "09.10.2016 16:07:48"??
In v3.0:
%{date:Event-Timestamp}
Enable it via:
$ cd raddb/mods-enabled $ ln -s ../mods-available/date
And edit raddb/mods-available/date to get the format you want.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
participants (3)
-
Alan DeKok -
Anirudh Malhotra -
rocky marciano