linelog csv quoting problem

Adamczak Krzysztof kradamcz at gmail.com
Thu Jul 14 12:46:21 CEST 2016


Hey guys,

I've another question. I need csv accounting - I used linelog for
this. Basically I have:

linelog csv_acct_log {

...

Accounting-Request {
                Start =
"\"%m/%d/%Y\",\"%H:%G\",\"%{Acct-Status-Type}\",\"%{User-Name}\",\"%{Auth-Type}\",\"%{User-Name}\",\"%{NAS-IP-Address}\",\"%{NAS-Port}\",\"%{Service-Type}\",\"%{Framed-Protocol}\",\"%{Framed-IP-Address}\",\"%{Framed-IP-Netmask}\"..."

...

}

It works great - the only problem is that I want to use double quotes
when there's attribute and don't use them when attribute is not
present. In CSV file it should like this
"07/14/2016","10:59:16","Interim","login at mycompany.com.pl",,,"some other value"

The best solution would be to do it directly in linelog module - maybe
using conditional syntax? I tried it but I haven't succeed yet.
Otherwise I have to do it in unlang outside linelog.

I tried something like that:
%{%{Framed-Compression}:-%{control:empty}}
but it doesn't allow me to introduce quoting.

Any ideas?

thanks,
Chris


More information about the Freeradius-Users mailing list