LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-05-2010, 08:33 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
Using Command and script to build a program which can do Exception-statistic in log.


What I am going to do is:

I have a log file and there are many different types of exception in this file. These could be looked as follow:

Code:
...
2010-08-05 05:36:17,942 WARN  [de.proactiv.postbox.services.authorizationcomponentaccess.adapter.AuthorizationComponentAdapterImpl] (WorkerThread#10[130.144.156.86:1549]) com.fsp.org.rt.api.ORGNoCompetenceException: ORGCompInfoFactory: 
...
2010-08-05 06:54:48,730 ERROR [blueline.seratio] (WorkerThread#36[130.144.156.78:1876]) java.net.SocketException: Connection reset by peer
...
One can see there two types of exceptions: ORGNoCompetenceException and SocketException.

I will filter out the name/type of exception and the number of each type of exception. At last, this statistic data will write to file and create a Excel table.

Any idea?


Regards

Thomas
 
Old 08-05-2010, 04:40 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,826

Rep: Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973Reputation: 1973
Sounds like a job for awk to me. Or possibly sed; it depends on exactly what you need to extract.

Which strings do you need to grab, and how do you want the output to look? Also, is there any variability in the format of the input lines?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Program terminated with signal SIGFPE, Arithmetic exception shichangyou2 Linux - Newbie 1 05-21-2010 08:57 PM
when is CPL changed to 0 when a user program divide by zero exception happens? titan22 Linux - Kernel 4 04-14-2009 03:07 PM
Is their a program or script that can execute a command from an email SuperDude123 Linux - Software 15 03-18-2009 07:30 PM
I Need a program do try-catch for Exception In Linux? saeedeh1363 Programming 2 09-04-2007 05:49 AM
Command to log a user out? Or restart X within a script? BogusTrumper Linux - Desktop 1 06-29-2007 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration