Urgent---Program for getting Exception from a log

Hi Friends,

I am new to Unix,

Now I am Working with shell scripting in my company

Description:-By executing that script I need to get the exception from the log file
I need the program for getting the Exceptions from the logfile,,and that program should be generic...I mean if i want to get the exception from any directory i need to get the exception without any changes or very small chenges in script

If you can help me out,,it will be really very helpful,,

Thanks alot In Advance:)

Hi Guys,
Any help in the above request????????

Thanks in advance

How are you identifying an exception? Seems if it's key word or some string grep would do it.

Giving us a definition of exception would be very useful to solving this.:confused:

Actually The Logfile will contains Different type exceptions.
for example ,Java exceptions , database related exceptions,

sample exception snippet from the log file

2007-11-13 05:12:43,899 - [ERROR] : Threadid = 32, While executing [invoke] enco
untered [com.get.prodapi.exception.ProductNotFoundException] : [Could
not find Product data for fii = 32637174 at
com.get.prodapi.dao.ProductDAO.getProductInfoByFii(ProductDAO.java:782)]
at com.tibco.plugin.java.JavaActivity.eval(JavaActivity.java:395)
at com.tibco.pe.plugin.Activity.eval(Activity.java:209)
at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:541)
at com.tibco.pe.core.Job.a(Job.java:709)
at com.tibco.pe.core.Job.l(Job.java:499)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200
)

This is one of the exception from the log file...
I dont want to go and explicitly see for the how many Exceptions are there and what are the exceptions in the log file...

By Executing my Generic script I want to get the exceptions from the log file which ever I will specify

I think this would be very clear

Appriciate your help.

Thanks In Advance,
Anji

Show us what you have come up with so far for a solution.

I am completely new to shell scripting,,
But also with a searching I did some code which will grep the Exception from the log file,,,,but I want to get the whole exceptions from the log file

I cant show up my code for security purpose(bcoz my collegues are also be the part of this forum only),but I can show you up the same code like that

for example snippet which we can modify for our requirements

grep $1 Exmple.log | awk 'BEGIN {i=0} {i=i+$1} END {print (i)}'

it searches for a pattern
i is a variable
$1 means search pattern and
Example.log is the filename to be searched

Can you help me out this please?

Thanks Guys
Anji