aspose file tools*
The moose likes Java in General and the fly likes searching in log files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "searching in log files" Watch "searching in log files" New topic
Author

searching in log files

berender mavi
Ranch Hand

Joined: Feb 18, 2011
Posts: 31
Hi friends

I have multiple log file of my application.I have to search a string from these file.currently i am using shell script to grep and cut some fields of that line in which string matched but it is giving response almost in 5 minute which is too much.

have we any alternative in java to search from multiple files which is faster than shell script.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

Unlikely. grep is quite fast, and if that's too slow then I doubt Java will be any faster.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
berender mavi
Ranch Hand

Joined: Feb 18, 2011
Posts: 31
grep is working slow because there are 5 days logs ,i think 60 text files each file with a lot of data.

is there not any fast searching than it in Perl also.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

You can try, but sometimes the amount of data is so large that it will take a lot of time, no matter what technique you use.
 
wood burning stoves
 
subject: searching in log files