This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

searching in log files  RSS feed

 
berender mavi
Ranch Hand
Posts: 32
  • 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
Posts: 20893
81
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: 32
  • 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
Posts: 20893
81
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
Boost this thread!