The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
quick script C shell ajp7701 Shell Programming and Scripting 1 03-18-2008 01:31 PM
A little guidance needed :) shadow0001 Shell Programming and Scripting 9 03-07-2008 11:16 AM
Quick help needed in the Shell Script namishtiwari Shell Programming and Scripting 1 02-01-2008 06:44 AM
need a quick basic shell script help eb222 Shell Programming and Scripting 6 11-22-2007 06:00 AM
IP Address changes - Quick Help Needed. gingerd2003 IP Networking 4 02-22-2007 08:39 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-07-2008
Registered User
 

Join Date: Aug 2008
Location: Chennai
Posts: 25
Lightbulb 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.

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

Last edited by senthilkumar_ak; 08-07-2008 at 10:12 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 08-07-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Show us sample log entries so we can get the time check for you.
Reply With Quote
  #3  
Old 08-07-2008
Registered User
 

Join Date: Aug 2008
Location: Chennai
Posts: 25
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
Reply With Quote
  #4  
Old 08-08-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
This looks identical to Please suggest some changes in my code
Reply With Quote
  #5  
Old 08-08-2008
Registered User
 

Join Date: Aug 2008
Location: Chennai
Posts: 25
Yes we are trying to reduce the time of script by some logic, but the result is not know yet
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
grep, sed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0