|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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:13I need the script print number of connections in each minute from 00:40 and 01:13 |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
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 | ||
|
![]() |
| Thread Tools | Search this Thread |
| 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 |
|
|