Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Get connection count over a period of time

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-22-2013
anil510 anil510 is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 16 March 2015, 2:50 AM EDT
Posts: 100
Thanks: 47
Thanked 2 Times in 2 Posts
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 Unix and Linux 03-22-2013
anbu23's Unix or Linux Image
anbu23 anbu23 is offline Forum Advisor  
Advisor
 
Join Date: Mar 2006
Last Activity: 1 September 2015, 7:11 AM EDT
Location: Bangalore,India
Posts: 2,142
Thanks: 15
Thanked 154 Times in 146 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 10:16 AM
Start Time and period of a PID mohtashims UNIX for Dummies Questions & Answers 16 12-12-2011 09:33 AM
Calculate Time Period in Scripting anishkumarv Shell Programming and Scripting 5 03-17-2011 11:17 AM
Determining load average over a period of time proactiveaditya UNIX for Dummies Questions & Answers 3 11-06-2009 09:55 AM
Run job for a period of time cooldude Shell Programming and Scripting 5 03-06-2006 12:53 PM



All times are GMT -4. The time now is 06:51 AM.