say_hi_ravi |
04-17-2013 07:04 AM |
How to find a specific word between two lines having same another word..
Hi,
First of all apologies for that poor statement I wrote - my bad english :-(
Let me elaborate in example what I exactly need.
I have a java app log file containing different exceptions.
Code:
$ vi java.log
2013-01-23 21:19:32,621 INFO [STDOUT] (my-nio-server-WorkerThread-4029) [LCDS]01/23/2013 GatewayEndpoint 'gateway-endpoint' failed to process a synchronized authentication.
flex.messaging.security.SecurityException: External login command required. Please check your security configuration.
at flex.messaging.security.LoginManager.login(LoginManager.java:245)
at flex.messaging.endpoints.GatewayEndpoint$GatewayEndpointProtocolHandler.processAuthenticationSyncOperation(GatewayEndpoint.java:874)
at flex.messaging.endpoints.GatewayEndpoint$GatewayEndpointProtocolHandler.processReceivedGatewayMessage(GatewayEndpoint.java:836)
at flex.messaging.endpoints.GatewayEndpoint$GatewayEndpointProtocolHandler.processReceivedMessage(GatewayEndpoint.java.exception:779)
at flex.messaging.endpoints.AMFSocketProtocolHandler.processReceivedMessageChunk(AMFSocketProtocolHandler.java:158)
at flex.messaging.io.amfsocket.AMFSocketInput.read(AMFSocketInput.java:139)
at flex.messaging.endpoints.AMFSocketProtocolHandler.doRead(AMFSocketProtocolHandler.java:132)
2013-01-23 22:30:44,044 INFO [org.apache.axis2.transport.http.HTTPSender] (http-0.0.0.0-8080-9) Unable to sendViaPost to url[https://www.zuora.com/apps/services/a/43.0]
org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
at org.apache.commons.httpclient.HttpClient.execute(HttpClient.java.exception:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
2013-01-23 22:30:44,044 INFO [org.apache.axis2.transport.http.HTTPSender] (http-0.0.0.0-8080-9) Unable to sendViaPost to url[https://www.zuora.com/apps/services/a/43.0]
org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout.exception(MultiThreadedHttpConnectionManager.java:416)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
I want to find how many "exception" words are there between line having "INFO" word in them.
ie. for example, in below section there are two exception errors..
Code:
2013-01-23 21:19:32,621 INFO [STDOUT] (my-nio-server-WorkerThread-4029) [LCDS]01/23/2013 GatewayEndpoint 'gateway-endpoint' failed to process a synchronized authentication.
flex.messaging.security.SecurityException: External login command required. Please check your security configuration.
at flex.messaging.security.LoginManager.login(LoginManager.java:245)
at flex.messaging.endpoints.GatewayEndpoint$GatewayEndpointProtocolHandler.processAuthenticationSyncOperation(GatewayEndpoint.java:874)
Unable to sendViaPost to url[https://www.zuora.com/apps/services/a/43.0]
org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
2013-01-23 22:30:44,044 INFO [org.apache.axis2.transport.http.HTTPSender] (http-0.0.0.0-8080-9) Unable to sendViaPost to url
Thanks in advance.
Regards,
Ravi
|