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.
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