UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 11th, 2005, 03:44 AM
telukuntla telukuntla is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 telukuntla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
AWK help needed

Hi ,

I am new to AWK. I need to write a program which will search my logfiles for the given string and let me know the count and whether that is exeisting in that or not.

eg: serch key word is "java.lang.NullPointer".

How could i do that. I want to give list of exception names and search.

If code is given that will be a great help.

Thanks in advance,
Ashok

Reply With Quote
  #2  
Old January 11th, 2005, 03:58 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,077 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 13 h 40 m 11 sec
Reputation Power: 8
try grep for this

grep -c
grep -n

see manual pages

Reply With Quote
  #3  
Old January 11th, 2005, 04:16 AM
telukuntla telukuntla is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 telukuntla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I wanted to use AWK and try to generate a report kind of stuff....

Reply With Quote
  #4  
Old January 11th, 2005, 04:35 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,077 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 13 h 40 m 11 sec
Reputation Power: 8
the Q was

Quote:
I need to write a program which will search my logfiles for the given string and let me know the count and whether that is exeisting in that or not.


next time post a precise request.
i will not give awk lessons on line, try something like
/matchstring/{ do something; }

the awk programming language by aho, kernighan, weinberger
by addison wesley ISBN 0-201-07981-X (my version: 1988) is a great book.

NOTA: on large files,i would NOT use awk, read awk's man pages
to understand why.

Last edited by guggach : January 11th, 2005 at 04:41 AM. Reason: changes

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > AWK help needed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway