title: Is there a script to parse radius accounting flat files for export to seperate mysql server
body: <p>I have been searching for an answer to import flat files for radius accounting records into a seperate MYSQL server (not hosted on the same radius server).
  We have months worth of reply-detail logs, auth-detail logs and detail logs from 4 different servers that needs to be imported.</p>
  
  <p>A typical reply packet looks as follows - I used a dummy ip for demonstration purposes.</p>
  
  <blockquote>
    <p>Thu Jul 23 00:00:13 2015
    Packet-Type = Access-Request
    Framed-Protocol = PPP
    User-Name = "xxxx@adsl.xxxxx.xx"
    CHAP-Password = 0x0111d9dr56ve5c417e42962f0d58f0c89
    NAS-Port-Type = Ethernet
    NAS-Port = 4587858
    NAS-Port-Id = "1/0/0/531"
    Service-Type = Framed-User
    NAS-IP-Address = 1.1.1.1
    Acct-Session-Id = "00460152"
    CHAP-Challenge = 0x03298b01bef9dc99e7d33e4038462a8e
    Message-Authenticator = 0x321aaa0d3eac236f771a4caf4ad84874
    Proxy-State = 0x313239</p>
    
    <p>Thu Jul 23 00:00:14 2015
    Packet-Type = Access-Request
    Framed-Protocol = PPP
    User-Name = "xxxx@wimax.xxxxx.xx"
    CHAP-Password = 0x02b0764233ba26c11994d61cfe663668b0
    NAS-Port = 655324
    NAS-Port-Id = "Uniq-Sess-ID869"
    Connect-Info = "1000000000"
    NAS-Port-Type = Virtual
    Service-Type = Framed-User
    NAS-IP-Address = 1.1.1.1
    Acct-Session-Id = "0009FFDC"
    CHAP-Challenge = 0xb2627204f7c8982beaf12f59cd1e8620
    Message-Authenticator = 0x3f1dba6b5d8b9ee0a0963ce76233086b
    Proxy-State = 0x3638</p>
  </blockquote>
  
  <p>I need a script that can parse the flat file to something like this. I am currently busy with a perl script to achieve this, but if there is an existing script to do this even better.</p>
  
  <blockquote>
    <p>Header fields:
    Date; Packet-Type;PPP;Framed-Protocol; User-Name; CHAP-Password ;NAS-Port;NAS-Port-Type ;NAS-Port;Connect-Info ;NAS-Port-Id ;Service-Type;NAS-IP-Address; Acct-Session-Id;CHAP-Challenge; Message-Authenticator; Proxy-State</p>
    
    <p>Thu Jul 23 00:00:13 2015; Access-Request;PPP; "xxxx@adsl.xxxxx.xx"; 0x0111d9dr56ve5c417e42962f0d58f0c89;Ethernet;4587858;;"1/0/0/531";Framed-User;1.1.1.1; "00460152";0x03298b01bef9dc99e7d33e4038462a8e; 0x321aaa0d3eac236f771a4caf4ad84874; 0x313239</p>
    
    <p>Thu Jul 23 00:00:14 2015;Access-Request; PPP;"xxxx@wimax.xxxxx.xx"; 0x02b0764233ba26c11994d61cfe663668b0;655324; "Uniq-Sess-ID869";"1000000000";Framed-User; 1.1.1.1; "0009FFDC"; 0xb2627204f7c8982beaf12f59cd1e8620; 0x3f1dba6b5d8b9ee0a0963ce76233086b; 0x3638</p>
  </blockquote>