This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Performance and the fly likes logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "logging" Watch "logging" New topic


Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1888
In our production environment, we have log files created every 1 Hr on average. Size of file varies.sometimes goes upto 50MB.In UNIX environment we use grep command to search particular record. But this method of viewing request is not very user friendly.
What are varios methods to search the strings in multiple log files?

Pallu Sagar

Joined: Dec 04, 2009
Posts: 16
find . -exec grep "www.athabasca" '{}' \; -print
This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.

If you want to just find each file then pass it on for processing use the -q grep option. This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.

find . -exec grep -q "www.athabasca" '{}' \; -print

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1888
Suprisingly I also found the above text here
Pallu Sagar

Joined: Dec 04, 2009
Posts: 16
yeah, does it solved your prob ?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63052

"The Sagar", please check your private messages for an important administrative matter.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 862
Check out splunk. It is software that does exactly what you want with a web interface. It is also free with limited use. You should be able to download it and load your logs into it in a few minutes.

an intro video - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
I agree. Here's the link:
subject: logging
It's not a secret anymore!