auth and detail logs into json format?

J E H A N Z A I B jehanzaib.kiani at gmail.com
Thu Apr 26 01:20:59 CEST 2018


You mean

instantiate {

        linelog_postauth

}

On Thu, Apr 26, 2018 at 11:10 AM, Arran Cudbard-Bell <
a.cudbardb at freeradius.org> wrote:

>
>
> > On Apr 26, 2018, at 10:32 AM, J E H A N Z A I B <
> jehanzaib.kiani at gmail.com> wrote:
> >
> > Thank you cedric,
> >
> > I have just installed rlm_rest module (/usr/lib64/freeradius/rlm_
> rest.so)
> >
> > i added in my linelog  (i will just start from auth logs for now)
> >
> > linelog linelog_postauth {
> >    format = "%t linelog_postauth \%{Packet-Type} connecting for
> > %{jsonquote:%{User-Name}} (%{Packet-Type})"
> >    filename = ${logdir}/linelog_json
> >    permissions = 0604
> >    reference = "messages.%{%{reply:Packet-Type}:-format}"
> >                messages {
> >                Access-Reject =
> > "{\"Datetime\":\"%t\",\"Module_Name\":\"linelog_
> postauth\",\"Packet-Type\":\"%{reply:Packet-Type}\",\"
> requestID\":\"%n\",\"User-Name\":\"%{jsonquote:%{User-
> Name}}\",\"Realm\":\"%{Realm}\",\"Reject-Cause\":\"%{
> jsonquote:%{%{session-state:Module-Failure-Message}:-%{
> Module-Failure-Message}}}\",\"NAS-IP-Address\":\"%{NAS-IP-
> Address}\",\"NAS-Port\":\"%{NAS-Port}\",\"Service-Type\":\
> "%{Service-Type}\",\"Framed-MTU\":\"%{Framed-MTU}\",\"
> State\":\"%{State}\",\"Class\":\"%{Class}\",\"Vendor-
> Specific\":\"%{Vendor-Specific}\",\"Session-Timeout\
> ":\"%{Session-Timeout}\",\"Idle-Timeout\":\"%{Idle-
> Timeout}\",\"Termination-Action\":\"%{Termination-
> Action}\",\"Called-Station-Id\":\"%{Called-Station-Id}\",\"
> Calling-Station-Id\":\"%{Calling-Station-Id}\",\"NAS-Identifier\":\"%{NAS-
> Identifier}\",\"Proxy-State\":\"%{Proxy-State}\",\"Login-
> LAT-Service\":\"%{Login-LAT-Service}\",\"Login-LAT-Node\":
> \"%{Login-LAT-Node}\",\"Login-LAT-Group\":\"%{Login-LAT-
> Group}\",\"Framed-AppleTalk-Link\":\"%{Framed-AppleTalk-
> Link}\",\"Framed-AppleTalk-Network\":\"%{Framed-
> AppleTalk-Network}\",\"Framed-AppleTalk-Zone\":\"%{Framed-
> AppleTalk-Zone}\",\"CHAP-Challenge\":\"%{CHAP-
> Challenge}\",\"NAS-Port-Type\":\"%{NAS-Port-Type}\",\"Port-
> Limit\":\"%{Port-Limit}\",\"Login-LAT-Port\":\"%{Login-LAT-Port}\"}"
> >                Access-Challenge =
> > "{\"Datetime\":\"%t\",\"Module_Name\":\"linelog_
> postauth\",\"Packet-Type\":\"%{reply:Packet-Type}\",\"
> requestID\":\"%n\",\"User-Name\":\"%{jsonquote:%{User-
> Name}}\",\"Realm\":\"%{Realm}\",\"NAS-IP-Address\":\"%{NAS-
> IP-Address}\",\"NAS-Port\":\"%{NAS-Port}\",\"Service-Type\":
> \"%{Service-Type}\",\"Framed-Protocol\":\"%{Framed-
> Protocol}\",\"Framed-IP-Address\":\"%{Framed-IP-Address}\",\"Framed-IP-
> Netmask\":\"%{Framed-IP-Netmask}\",\"Framed-Routing\":
> \"%{Framed-Routing}\",\"Filter-Id\":\"%{Filter-Id}\",\
> "Framed-MTU\":\"%{Framed-MTU}\",\"Framed-Compression\":\"%{
> Framed-Compression}\",\"Login-IP-Host\":\"%{Login-IP-Host}\"
> ,\"Login-Service\":\"%{Login-Service}\",\"Login-TCP-Port\":
> \"%{Login-TCP-Port}\",\"Reply-Message\":\"%{Reply-Message}\"
> ,\"Callback-Number\":\"%{Callback-Number}\",\"Callback-
> Id\":\"%{Callback-Id}\",\"Framed-Route\":\"%{Framed-
> Route}\",\"Framed-IPX-Network\":\"%{Framed-IPX-Network}\",\"
> State\":\"%{State}\",\"Class\":\"%{Class}\",\"Vendor-
> Specific\":\"%{Vendor-Specific}\",\"Session-Timeout\
> ":\"%{Session-Timeout}\",\"Idle-Timeout\":\"%{Idle-
> Timeout}\",\"Termination-Action\":\"%{Termination-
> Action}\",\"Called-Station-Id\":\"%{Called-Station-Id}\",\"
> Calling-Station-Id\":\"%{Calling-Station-Id}\",\"NAS-Identifier\":\"%{NAS-
> Identifier}\",\"Proxy-State\":\"%{Proxy-State}\",\"Login-
> LAT-Service\":\"%{Login-LAT-Service}\",\"Login-LAT-Node\":
> \"%{Login-LAT-Node}\",\"Login-LAT-Group\":\"%{Login-LAT-
> Group}\",\"Framed-AppleTalk-Link\":\"%{Framed-AppleTalk-
> Link}\",\"Framed-AppleTalk-Network\":\"%{Framed-
> AppleTalk-Network}\",\"Framed-AppleTalk-Zone\":\"%{Framed-
> AppleTalk-Zone}\",\"CHAP-Challenge\":\"%{CHAP-
> Challenge}\",\"NAS-Port-Type\":\"%{NAS-Port-Type}\",\"Port-
> Limit\":\"%{Port-Limit}\",\"Login-LAT-Port\":\"%{Login-LAT-Port}\"}"
> >               }
> > }
> >
> >
> > The error i am getting is
> >
> >  # Instantiating module "linelog" from file /etc/raddb/mods-enabled/
> linelog
> > /etc/raddb/mods-enabled/linelog[131]: Failed parsing expanded string:
> > /etc/raddb/mods-enabled/linelog[131]: ...uth \%{Packet-Type} connecting
> for
> > %{jsonquote:%{User-Name}} (%{Packet-Type})
> > /etc/raddb/mods-enabled/linelog[131]:
> > ^ Unknown module
> >
> > looks like the module is not loaded. do i need to load specifically
> > somewhere in the radius ?
>
> List it in the instantiate section of radiusd.conf
>
> -Arran
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html
>



-- 
Regards,
Jehanzaib


More information about the Freeradius-Users mailing list