Visit Our UNIX and Linux User Community


Urgent---Program for getting Exception from a log


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Urgent---Program for getting Exception from a log
# 1  
Old 02-20-2008
MySQL 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 AdvanceSmilie
# 2  
Old 02-20-2008
Hi Guys,
Any help in the above request????????

Thanks in advance
# 3  
Old 02-20-2008
Finding exceptions RFI

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.Smilie
# 4  
Old 02-21-2008
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
# 5  
Old 02-21-2008
Show us what you have come up with so far for a solution.
# 6  
Old 02-21-2008
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

Previous Thread | Next Thread
Test Your Knowledge in Computers #657
Difficulty: Easy
The last retail version of MS-DOS was MS-DOS 7.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Monitor logs for exception and if exception come then sent an email

Hi Folks, please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies

2. Programming

Wrapper for unix program - urgent help needed

Hello all , i need some help asap i have a program that keeps killing the machine when i did google searches and 2 days later i ran strace it seems the programm keeps making a system call to gettimeofday to i guess increment a counter ? gettimeofday({1347986584, 464904}, NULL) = 0... (6 Replies)
Discussion started by: NetworkLearning
6 Replies

3. Programming

An error in my c++ program... please help urgent.

The following is a program to convert an infix expression to postfix expression. //Convert an infix expression to postfix expression... #include<iostream> #include<string> #include<cstdlib> using namespace std; char ifx,pfx,stk; int top=-1,n; void push(char ch) { if(top!=n) ... (6 Replies)
Discussion started by: poonam.gaigole
6 Replies

4. Programming

urgent help with file manipulation program

Hey, i am trying to write a program that takes multiple files as command line arguments, then outputs them to a single file. i also need the option to read them back out again. essentially what i am trying to create is an archiver, however, a very simple one. The program i have accomplished so far... (1 Reply)
Discussion started by: wezzyb
1 Replies

5. Shell Programming and Scripting

Program Bash VERY URGENT

Hello I have to do a program in Bash, need help because it does not go out for me and go enough time with this!! Five directories(boards of directors) that more occupy, arranged according to size. To measure the size of every directory(board of directors) there must not be included the size... (1 Reply)
Discussion started by: danihj
1 Replies

6. UNIX for Dummies Questions & Answers

getting help on finding exception in running log file

Hi all, I am trying to write a script for an application server log file where i want to put this script as a cron tab entry and it will check the server log file last 1000/500 line for every fifteen minute. i am using the script like this. count=`tail -n 1000 Trace.log | grep -c... (1 Reply)
Discussion started by: senthilkumar_ak
1 Replies

7. Shell Programming and Scripting

redirect exception messages from program

Hi, I have a script which invoke a java program and I would like to know whether it is possible to log the exception thrown by the program to a log file in the script? Thanks! (1 Reply)
Discussion started by: mpang_
1 Replies

8. AIX

URGENT:Program is not dropping core on customer AIX Machine

hi We have a program which is running on cutomer end,and when its crashing its not dropping core, we asked them to check ulimit,they say that its unlimited. Even when they crash the program manually by using command kill -ABRT <pid> its not dropping the core,on our end when we use same... (1 Reply)
Discussion started by: khan_069
1 Replies

9. Shell Programming and Scripting

Very Urgent help required in Shell Program

How do I Ftp, and rename multiple files in one unix script. I have to send it with .tmp extension , then rename it to .txt after FTP is done . I need to do a Mass rename of more than 1 file in a shell script , Urgent help required. (1 Reply)
Discussion started by: Suppandi
1 Replies

10. UNIX for Dummies Questions & Answers

Urgent!! How to write a shell program to execute command to access internet?

hi, I am new ot unix. So, can i write a shell(c shell or korn shell) program to access internet? I mean if I run the program, it can access specified url and then copy the html to a file? Can anyone help me? And how can make the program runs every 1 hr? new comer (2 Replies)
Discussion started by: firebirdonfire
2 Replies

Featured Tech Videos