This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


JavaRanch » Java Forums » Java » Performance
Bookmark "logging" Watch "logging" New topic
Author

logging

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Hi,
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?


MH
Pallu Sagar
Greenhorn

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


-Sagar
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Thanks.
Suprisingly I also found the above text here
Pallu Sagar
Greenhorn

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

Joined: Jan 10, 2002
Posts: 61315
    
  66

"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: 861
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.

http://www.splunk.com

an intro video
http://www.splunk.com/view/SP-CAAAEZY


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
 
GeeCON Prague 2014
 
subject: logging