![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mask_pop_op() Stack underflow error ! | arunkumar_mca | High Level Programming | 1 | 03-17-2008 02:38 PM |
| get stack trace from C program on Solaris 8 | rydahl | Filesystems, Disks and Memory | 4 | 03-23-2007 09:53 AM |
| help required - stack trace | ranj@chn | UNIX for Advanced & Expert Users | 9 | 09-26-2006 05:20 AM |
| printing a stack trace with backtrace | dmirza | High Level Programming | 2 | 11-03-2005 11:27 AM |
| Core file without a readable stack trace | ciregbu | High Level Programming | 0 | 10-02-2002 08:42 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Need to capture ERROR msg and stack trace
Hi all,
I was hoping someone can point me in the right direction. I’m trying to filter out errors from a web log- any lines with ERROR in it. I know I could simply use the grep command to do this. However, there are times when a stack trace follows the error line. I would like to capture these lines as well. Here is a snippet of the web log: 2006-01-07 18:39:18,212 host123 WARN com.host123 .elf.UserQuest - Quest/option {o.q.more.paper.osc#0} references unknown dependent {t.what.form.file.more.action} in application {src-code}. Please revise. 2006-01-07 18:39:18,212 host123 WARN com.host123 .elf.UserQuest - Quest/option {o.q.more.paper.osc#1} references unknown dependent {t.what.form.file.more.action} in application {src-code}. Please revise. 2006-01-07 18:40:34,281 cessor32 ERROR com.host123 .email.DirectMailer - Unable to connect to server {1.1.1.1}: javax.mail.MessagingException: Could not connect to SMTP host: 1.1.1.1, port: 25, response: 451 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:996) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:197) at javax.mail.Service.connect(Service.java:233) at javax.mail.Service.connect(Service.java:134) at com.host123.email.DirectMailer.deliverMessage(DirectMailer.java:191) at com.host123.email.DirectMailer.send(DirectMailer.java:153) at com.host123.webface.util.Notifications.sendEmailX(Notifications.java:126) at com.host123.webface.util.Notifications.sendEmail(Notifications.java:91) at com.host123.webface.util.Notifications.sendEmail(Notifications.java:145) at com.host123.edp.webface.action.DocRecoveryActionProcessor.perform(DocRecoveryActionProcessor.java:81 ) 2006-01-07 18:43:45,811 host123 WARN com.host123.webface.RequestProcessorImpl - beanId = 7061279 beanTag= Docket , bean is null or unaccessible 2006-01-07 18:43:46,029 host123 WARN com.host123.webface.RequestProcessorImpl - beanId = 7061279 beanTag= Docket , bean is null or unaccessible I would like to capture only the following lines and redirect the output to a file: 2006-01-07 18:40:34,281 cessor32 ERROR com.host123 .email.DirectMailer - Unable to connect to server {1.1.1.1}: javax.mail.MessagingException: Could not connect to SMTP host: 1.1.1.1, port: 25, response: 451 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:996) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:197) at javax.mail.Service.connect(Service.java:233) at javax.mail.Service.connect(Service.java:134) at com.host123.email.DirectMailer.deliverMessage(DirectMailer.java:191) at com.host123.email.DirectMailer.send(DirectMailer.java:153) at com.host123.webface.util.Notifications.sendEmailX(Notifications.java:126) at com.host123.webface.util.Notifications.sendEmail(Notifications.java:91) at com.host123.webface.util.Notifications.sendEmail(Notifications.java:145) at com.host123.edp.webface.action.DocRecoveryActionProcessor.perform(DocRecoveryActionProcessor.java:81 ) I was thinking of incorporating some conditional logic, where we filter out lines with ERROR and also any lines thereafter that start with a white space (the stack trace lines start with a tab). Couldn't figure out how to tie that in with grep. Thanks in advance for any ideas. gsw |
| Forum Sponsor | ||
|
|
| Thread Tools | |
| Display Modes | |
|
|