Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release > by-pkgid > aa0a0c745bf74bd0c70c4944117a40d3 > files > 45

gnugk-2.3.1-1mdv2010.1.x86_64.rpm

Hi All

I used the attached java app to parse out the log of a certain date 
from the log file generated by the gatekeeper. Given a starting date 
this program can also dump all the logs of different dates in seperate file. 
Hope it helps everyone. Here is how you run:

  java logparser [-o --only] <log_file_name> <output_location> [Date_To_Start_With] 

The <log_file_name> is the path to the log file where as output_location 
specifies the target location where the extracted logs should be placed. 
[Date_To_Start_With] specifies the certain date you want to start with 
(Format is Year/Month/Day, this is basically the format use by the log file), 
if you dont specify it the program will simply start dumping logs of every day 
in different file. Finally the --only switch specifies that only the specified 
date should be extracted. Examples are:

    java logparser /root/gkdump.log /home/mylogs 2004/03/30 
  This command will dump all the records starting from 20th March 2004 
  in /home/mylogs 

    java logparser --only /root/gkdump.log /home/mylogs 2004/03/30 
  This command will dump only the log of 20th March 2004 in /home/mylogs 

    java logparser /root/gkdump.log /home/mylogs 
  This command will dump all the logs of the different dates in different files 
  at /home/mylogs 

I have been successfuly using this code with 2.0.7 , i am not sure 
if the date format (specified in the log) is same in 2.2 but hopefuly 
it will be.

Regards 
-Saad Faisal <saad_faisal@etaleem.com>