Get connection count over a period of time | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Get connection count over a period of time

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-22-2013
anil510 anil510 is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 28 June 2014, 3:33 PM EDT
Posts: 76
Thanks: 38
Thanked 1 Time in 1 Post
Get connection count over a period of time

I used this script to get the connection to a domain in two specific minutes. I need to extend to give result over a range of minutes.

The below gives total number of connections in the minutes 00:40 and 01:13 on 22nd March.


Code:
 egrep "22/Mar/2013:00:40|22/Mar/2013:01:13" /usr/local/apache/domlogs/domain.com  | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":"$3}' | sort -nk1 -nk2 | uniq -c | sed 's/[ ]*//'
5 00:40
1 01:13

I need the script print number of connections in each minute from 00:40 and 01:13
Sponsored Links
    #2  
Old 03-22-2013
anbu23's Avatar
anbu23 anbu23 is offline Forum Advisor  
Advisor
 
Join Date: Mar 2006
Last Activity: 21 November 2014, 4:45 AM EST
Location: Bangalore,India
Posts: 2,091
Thanks: 12
Thanked 131 Times in 126 Posts

Code:
egrep "22/Mar/2013:00:[45][0-9]|22/Mar/2013:01:0[0-9]|22/Mar/2013:01:1[0-3]" /usr/local/apache/domlogs/domain.com

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
memory consumption over a time period danish0909 HP-UX 5 09-18-2012 11:16 AM
Start Time and period of a PID mohtashims UNIX for Dummies Questions & Answers 16 12-12-2011 10:33 AM
Calculate Time Period in Scripting anishkumarv Shell Programming and Scripting 5 03-17-2011 12:17 PM
Determining load average over a period of time proactiveaditya UNIX for Dummies Questions & Answers 3 11-06-2009 10:55 AM
Run job for a period of time cooldude Shell Programming and Scripting 5 03-06-2006 01:53 PM



All times are GMT -4. The time now is 01:42 PM.