The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 04:31 PM
A little guidance needed :) shadow0001 Shell Programming and Scripting 9 03-07-2008 02:16 PM
Quick help needed in the Shell Script namishtiwari Shell Programming and Scripting 1 02-01-2008 09:44 AM
need a quick basic shell script help eb222 Shell Programming and Scripting 6 11-22-2007 09:00 AM
IP Address changes - Quick Help Needed. gingerd2003 IP Networking 4 02-22-2007 11:39 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-07-2008
senthilkumar_ak senthilkumar_ak is offline
Registered User
  
 

Join Date: Aug 2008
Location: Chennai
Posts: 43
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 01:12 PM..
  #2 (permalink)  
Old 08-07-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
Show us sample log entries so we can get the time check for you.
  #3 (permalink)  
Old 08-08-2008
senthilkumar_ak senthilkumar_ak is offline
Registered User
  
 

Join Date: Aug 2008
Location: Chennai
Posts: 43
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
  #4 (permalink)  
Old 08-08-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
This looks identical to Please suggest some changes in my code
  #5 (permalink)  
Old 08-08-2008
senthilkumar_ak senthilkumar_ak is offline
Registered User
  
 

Join Date: Aug 2008
Location: Chennai
Posts: 43
Yes we are trying to reduce the time of script by some logic, but the result is not know yet
Sponsored Links
Closed Thread

Bookmarks

Tags
grep, sed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0