LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Unix script help (http://www.linuxquestions.org/questions/linux-general-1/unix-script-help-803021/)

javaholics 04-20-2010 04:45 AM

Unix script help
 
Hi

I have a big log file

:08,936 DEBUG [SoapUIMultiThreadedHttpConnectionManager] HttpConnectionManager.getConnection: config =
11:39:08,936 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Getting free connection,
11:39:08,989 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Freeing connection, hostConfig=HostConfiguration
11:39:08,989 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Notifying no-one, there are no waiting threads
11:39:09,046 INFO [SoapUILoadTestRunner] LoadTest [LoadTest 1] progress: 3.3893334E-4, 1
11:39:09,104 DEBUG [SoapUIMultiThreadedHttpConnectionManager] HttpConnectionManager.getConnection: config = HostConfiguration[, timeout = 0
11:39:09,105 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Getting free connection, hostConfig=HostConfiguration[host=
11:39:09,158 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Freeing connection, hostConfig=HostConfiguration[
11:39:09,159 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Notifying no-one, there are no waiting threads
11:39:09,282 DEBUG [SoapUIMultiThreadedHttpConnectionManager] HttpConnectionManager.getConnection: config =
11:39:09,282 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Getting free connection, hostConfig=HostConfiguration
11:39:09,335 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Freeing connection, hostConfig=HostConfiguration
11:39:09,335 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Notifying no-one, there are no waiting threads


I want to grep the first occurence of string "Notifying no-one, there are no waiting threads" and last occurence and calculate the count of which this string has appeared .And calculate time diffrence.

For eg
Fiest occurence
11:39:09,335 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Notifying no-one, there are no waiting threads

last occurence
12:33:09,335 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Notifying no-one, there are no waiting threads

Time difference is 12:33:09-11:39:09 between first occurrence and last occurrence and also count number of occurrences.

AlucardZero 04-20-2010 08:40 AM

What do you have already?

TB0ne 04-20-2010 09:19 AM

Quote:

Originally Posted by javaholics (Post 3941255)
Hi
I have a big log file

I want to grep the first occurence of string "Notifying no-one, there are no waiting threads" and last occurence and calculate the count of which this string has appeared .And calculate time diffrence.

For eg
Fiest occurence
11:39:09,335 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Notifying no-one, there are no waiting threads

last occurence
12:33:09,335 DEBUG [SoapUIMultiThreadedHttpConnectionManager] Notifying no-one, there are no waiting threads

Time difference is 12:33:09-11:39:09 between first occurrence and last occurrence and also count number of occurrences.

Great...we now know what you WANT to do. Where are you getting stuck? What have you written so far? For what version/distro of Linux??

We'll be glad to help you, but I doubt anyone is going to write your script for you. Post what you've written and where you're having a problem.


All times are GMT -5. The time now is 07:43 PM.