I have this log ...
I need to input it into a perl script that takes 2 arguments, an input file, i.e. the log above and an output file, that will contain the output,
eg. Rollback.pl input.log report.log
First, I need to search for the string "UNHANDLED" and within that stack trace, I need to find the string "RollbackExcept ion". If the "RollbackExcept ion" string is found, I need to find the "_TH" string, that's within "RollbackExcept ion".
Finally I need to print the date that's on the "UNHANDLED" line and the line that contains the "_TH" string.
The "UNHANDLED" string could contain more than 1 "RollbackExcept ion" string but I need to find just the 1st instance of "RollbackExcept ion" and then within that find the first instance of "_TH".
The delimiters could be [ERROR].
The date and "_TH" string should then be output to the "report.log " file.
Code:
[ERROR] [02 Sep 2009 11:33:17] [Trace] [WebContainer : 54] - infrastructure:ID_UNHANDLED: An un-handled server exception occu rred. Please contact your administrator. at .util.internal.HandleException.getRemoteException(HandleException.java(Compiled Code)) at .util.internal.HandleException.getRemoteException(HandleException.java(Compiled Co nested exception is: infrastructure:RUN_ID_RUNTIME: A runtime exception occurred: javax.transaction.RollbackException. at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at com.ibm.rmi.util.ProxyUtil$2.run(ProxyUtil.java(Compiled Code)) at java.security.AccessController.doPrivileged1(Native Method) at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code)) at com.ibm.rmi.util.ProxyUtil.invokeWithPrivilege(ProxyUtil.java(Compiled Code)) at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.ja at .interfaces.Search_TH.invokeStub nested exception is: javax.transaction.RollbackException at com.ibm.ws.Transaction.JTA.TransactionImpl.stage3CommitProcessing(TransactionImpl.java(Compiled Code)) at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java(Compiled Code)) at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java(Compiled Code)) at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java(Compiled Code)) at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java(Compiled Code)) at com.ibm.ws.Transaction.JTA.UserTransactionImpl.commit(UserTransactionImpl.java(Compiled Code)) at com.ibm.ejs.container.UserTransactionWrapper.commit(UserTransactionWrapper.java(Compiled Code)) at .util.transaction.ResourcesJTA.M-T00000(ResourcesJTA.java(Compiled Code)) at .util.transaction.TransactionInfo.commit(TransactionInfo.java(Compiled C [ERROR] [02 Sep 2009 11:33:18] [Trace.Tools] [WebContainer : 61] - infrastructure:RUN_ID_RECORD_NOT_FOUND: Record not found. [ERROR] [02 Sep 2009 11:33:18] [Trace.Tools] [WebContainer : 61] - infrastructure:RUN_ID_RECORD_NOT_FOUND: Record not found.
eg. Rollback.pl input.log report.log
First, I need to search for the string "UNHANDLED" and within that stack trace, I need to find the string "RollbackExcept ion". If the "RollbackExcept ion" string is found, I need to find the "_TH" string, that's within "RollbackExcept ion".
Finally I need to print the date that's on the "UNHANDLED" line and the line that contains the "_TH" string.
The "UNHANDLED" string could contain more than 1 "RollbackExcept ion" string but I need to find just the 1st instance of "RollbackExcept ion" and then within that find the first instance of "_TH".
The delimiters could be [ERROR].
The date and "_TH" string should then be output to the "report.log " file.
Comment