Shell script in tracking both the passed and failed login in a unix server

Can you help me in providing the following output or a quite similar to this from a shell script ?

*** Logins Summary Information *****

----------------------------------
Failed Login Attempts for Invalid Accounts

Date Time IP-ADD Account Attempts

2009-11-09 22:00:59 202.218.236.18 tko@yahoo.com = 14

--------------------------
Failed Login Attempts for Valid Accounts

Date Time IP-ADD Account Attempts

2009-11-09 22:00:59 202.218.236.10 joy@gmail.com = 10

---------------------------
Passed Login Attempts for Valid Accounts

Date Time IP-ADD Account Attempts

2009-11-09 22:00:59 202.218.236.18 yolie@yahoo.com = 10