• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logging

 
Arjun Shastry
Ranch Hand
Posts: 1898
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Pallu Sagar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1898
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
Suprisingly I also found the above text here
 
Pallu Sagar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, does it solved your prob ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The Sagar", please check your private messages for an important administrative matter.
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic