Guidance needed for quick script

Hi all,

I am trying to get the exception count daily from a log file which is more than 1 GB in size.

I am using loops which get the count of the exception and transaction. But i need to take this exception count for a time frame from 5.00 am to 5:00 pm.

I Think I can use to exact the error message in the loop. But i can use the sed to exact all the exception to a temp log then i can grep to that temp log which will speed up my script. like this

sed -n s/: 5:/,/:17:/p exception.log >> temp/log -> i am not sure about the syntax i need to check this. :o

Awaiting for your expertise on this issue.

Also i want to search some of the exception like in a log file. For that i used to call the checker loop each and every time..Is that any method available where i can search and take the exact count for the the string.

This is the method

checker()
{
count=`grep -c "$2" $1`
if [ $count -eq 0 ]
then
echo "There is no exception in the log file" >> mail.log
echo $count
else
echo "There is $count exception happened" >> mail.log
echo $count
fi
}

I am calling like

E1=`check "temp.log" "Suspend Exception"`
E2=`check "temp.log" "DataException" `
.
.
total_exp= `echo "E1 + E2"|bc -l`
echo " total no of expection $total_exp"

this is a snipet from the script

Regards,
Senthil Kumar AK

Show us sample log entries so we can get the time check for you.

Worker#1364lchalegreenVST: 10:02:11 336 ViewStatementBusinessLogic.validateRequestStatementService is unable to fulfil a request
Worker#0522keynotescriptCP: 21:59:47 899 CardProfileServiceAggregatorForCycleCut.getCardProfileData Exit
Worker#0522keynotescriptCP: 21:59:47 899 CardProfileServiceAggregatorForCycleCut.getCardProfileData Exit
Worker#0522keynotescriptCP: 21:59:47 899 CardProfileBusinessLogic.getCardProfile Time taken to get cardprofile is :::: 4.96 secs
Worker#0522keynotescriptCP: 21:59:47 900 CardProfileServiceBean.getCardProfile Exit

This looks identical to Please suggest some changes in my code

Yes we are trying to reduce the time of script by some logic, but the result is not know yet