This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 20495
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: 20495
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