Right so I have and input file which has a multitude of rows but I am only interested in $11
and $12
.
these fields look like the following:
$11
7.4ms
8.5ms
11.6ms
$12
TelegramHandlerPackingInfeedHanging
TelegramHandlerPackingOrderBufferHanging
Within $12
there are 10 distinct values.
I have the following Code which is returning these 10 values as well as some out puts that I need.
#!/usr/bin/gawk -f
BEGIN {
print "Testing glly"
} #End of BEGIN
{ #Start of MID
MSG_TYPE[substr($12,match($12,":")+1,match($12,")")-15)]++;
TIME_AR[$11]++;
SUM[i++] += $11;
} #End of MID
END {
for (MSG in MSG_TYPE) {
print MSG
print "Message Count: "MSG_TYPE[MSG]
print "MIN: "
print "MAX: "
print "Total MSG: "MSG_TYPE[MSG]
print "AVG: "SUM[sum]/MSG_TYPE[MSG]"ms"
}
} #End of END
The out put I am getting so far looks like the following:
Testing glly
TelegramHandlerPackingInfeedHanging
Message Count: 65128
MIN:
MAX:
Total MSG: 65128
AVG: 0ms
TelegramHandlerPackingOrderBufferHanging
Message Count: 68473
MIN:
MAX:
Total MSG: 68473
AVG: 0ms
What I am trying to do is you may have noticed that I have 2 more arrays, TIME_AR
and SUM
. My question is how can I modify my current script to return a single segment for the 10 distinct values but give me a total sum of the values in the array SUM
? I have tried to do this but it is returning 10 segments for each of the 10 distinct values.
Thanks in advance.
Reduced while still providing information.
Sorry, sample Input is as follows:
INFO 2016-06-15 00:00:28.273 TelegramDispatcher - --> Complete telegram dispatching took 11189.4ms (canHandle(69:TelegramHandlerTUNotification) took 0.0ms, handleTelegram took 11182.0ms, commit took 5.1ms, doACK took 1.8ms, doNAK took -0.0ms performAfterCommit took 0.3ms, failedCanHandle took 0.1ms)
INFO 2016-06-15 00:00:28.531 TelegramDispatcher - --> Complete telegram dispatching took 58.5ms (canHandle(60:TelegramHandlerPackingInfeedHanging) took 0.0ms, handleTelegram took 43.5ms, commit took 13.0ms, doACK took 1.4ms, doNAK took -0.0ms performAfterCommit took 0.3ms, failedCanHandle took 0.1ms)
INFO 2016-06-15 00:00:28.558 TelegramDispatcher - --> Complete telegram dispatching took 26.8ms (canHandle(61:TelegramHandlerPackingOrderBufferHanging) took 0.0ms, handleTelegram took 10.5ms, commit took 14.5ms, doACK took 1.2ms, doNAK took -0.0ms performAfterCommit took 0.4ms, failedCanHandle took 0.1ms)