On 26/11/2018 15.05, Peter Havekes wrote:

How can I log the IPv6 address in accounting in json format? The goodies
mention a custom log format, but how do I define a log format? Can
anyone provide a sample "CustomLogFormat.pm"?

The example below is based on file names and examples in goodies/logformat.cfg.

You could do this:
1) Copy Radiator's LogFormat.pm to /etc/radiator/CustomLogFormat.pm
2) Find and update two instances of
   "Radius::LogFormat" to "CustomLogFormat"
3) Locate accounting log JSON formatter by looking for
   "sub format_acctlog_json"
4) Look for "acct_status_type" and add "framed_ipv6_address" in the similar fashion. You need two changes in the sub.

You can use radpwtst for testing:
perl radpwtst -trace 4 -noauth -nostop Framed-IPv6-Address=2001:db8:148:100::31

This sends a single accounting start request. Your JSON log should have a new JSON key-value pair like below:

{...,"framed_ipv6_address":"2001:db8:148:100::31",...}

When it works, trim your CustomLogFormat to match your requirements.

Thanks,
Heikki

--
Heikki Vatiainen <[email protected]>

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, TACACS+, PAM, Active Directory,
EAP, TLS, TTLS, PEAP, WiMAX, RSA, Vasco, Yubikey, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, etc.
_______________________________________________
radiator mailing list
[email protected]
https://lists.open.com.au/mailman/listinfo/radiator

Reply via email to