Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

searching in log files

 
berender mavi
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20526
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unlikely. grep is quite fast, and if that's too slow then I doubt Java will be any faster.
 
berender mavi
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20526
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic