Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting


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

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-22-2013
Registered User
 
Join Date: Mar 2012
Posts: 49
Thanks: 22
Thanked 0 Times in 0 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 03-22-2013
anbu23's Avatar
anbu23 anbu23 is offline Forum Advisor  
Registered User
 
Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,952
Thanks: 6
Thanked 79 Times in 77 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
Reply

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 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 09:43 AM.