The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help in hour grep ali560045 Shell Programming and Scripting 0 01-31-2008 03:03 AM
AIX 5.3 12 Hour System Clock RTwitchell AIX 2 04-10-2007 05:02 PM
finding duplicate files by size and finding pattern matching and its count jerome Sukumar Shell Programming and Scripting 2 12-01-2006 04:20 AM
an hour less in 24 hour system bobo UNIX for Dummies Questions & Answers 3 10-23-2006 12:55 PM
1 Hour less bobo UNIX for Dummies Questions & Answers 6 05-16-2006 01:07 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-22-2008
Prince2 Prince2 is offline
Registered User
  
 

Join Date: May 2008
Posts: 2
Question Finding mail per hour

Hi,

i have a logfile of a mail server it looks like this:
d k 1004210238.380677500 1004210238.454490500 1004210238.679567500 3621 <VOLENDAM@Malawi.com> local.EDAM@Frankrijk.com 6053 81

I have got the following script to set the time in normal gmt time
and to filter de failed messages, but i want that the script asks me what date and what time i want to filter at the beginning of the script.

BEGIN{{print "list of failed mails:"}

{print "---------------------------------------------"}}
{if ($1 ~ /d/ && $2 ~ /z/) {nr =nr+1 ; printf $7" ""%s\n%s\n",(""), strftime("%c", $3) }}
END {{print "---------------------------------------------"}
{print "there are:",nr " failed mails"}}




Can anybody help me ?

Greetz Joost

Last edited by Prince2; 05-22-2008 at 06:47 AM..
  #2 (permalink)  
Old 05-22-2008
Prince2 Prince2 is offline
Registered User
  
 

Join Date: May 2008
Posts: 2
okay i have the input part its like :

Code:
BEGIN {
                printf "Date ?? (YYYY MM DD HH MM SS) "
                getline date < "-"
                start = mktime(date)
                print "list of failed emails", date
                print "-----------------------------------------------"
}
$1 == "d" && $2 == "d" && $3 >= start {
        nr++
        printf $7 "%s\n%s\n",(""), strftime("%c", $3)
}
END {
                print "-----------------------------------------------"
                print "there are:", nr, "failed emails"
}

But if i type my date at the beginning i have to put all info in there, YYYY,MM,DD,HH,MM,SS


I want that i only have to say the year, month,day

Can some body help me ?
  #3 (permalink)  
Old 05-22-2008
learnbash learnbash is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 96
Hi,

Could you tell us pls which mail server you are using?

Regards,
Bash
Closed Thread

Bookmarks

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 07:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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