On 15 Jul 2016, at 05:40, Matthew Newton <mcn4@leicester.ac.uk> wrote:
On Fri, Jul 15, 2016 at 10:26:55AM +0200, Adamczak Krzysztof wrote:
OK. I've got another idea. Please tell me what do you think of it. I could use perl just to format attributes to desired form (escaping, double quoting, config file which define necessary attribute / ordering) and then pass generated line to linelog. The idea is to let the linelog handle file writes and keep my perl module as simple as it could be.
Any thoughts?
linelog is a heck of a lot faster than perl. If you want to do this in production, I'd definitely do some speed benchmarks first.
Personally I'd either just write it out with linelog and then, like Alan said before, post-process if you really can't stand ',"",' in the files, or write a new xlat in rlm_expr to quote a non-null string and use that for all the attributes.
Some variant on linelog specifically for generating CSV/TSV files might be worthwhile, but pretty much everyone's got along with linelog just fine so far, so it doesn't seem to be worth the time to write one.
In v3.1.x you can use attribute refs to write out a raw value. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2