[rrd-users] Re: using grep on snmp collected data

Pitisi dpitisi at lfdj.com
Tue Nov 18 11:10:03 MET 2003


I have another solution for you:
for each line, you extract date and time et put it in format (order and fix
number of digits are important): yy/mm/dd:hh:mm:ss
You put your begin and end date in the same format

Then, use a string comparaison function to determine if the
extracted_and_reformated_date is between begin and end

DP

"gab.seun jones.ewulomi" a écrit :

> Hi people,
>
> I have a huge ascii text file with data collection point. the text file is
> of the form(below)
>
> How could I use grep/awk to grep for data between a time frame
>
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 10:15:00       3657.07
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 10:20:00       3976.85
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 10:25:00       5088.18
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 11:00:00       3471.26
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 11:05:00       4311.4
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 11:10:00      2000.9
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 12:50:00       3021.64
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 12:55:00       3385.86
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 13:00:00       3483.98
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 13:05:00       3920.98
> In Kbits        FR1 6/1.10 3/105 to  R2 31/10/03 14:00:00       5627.66
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 14:05:00       5252.07
> In Kbits        R1  6/1.10 3/105 to  R2 31/10/03 14:10:00       3768.24
>
> I can use awk and grep to get required columns and to get data for a set
> date but I dont know how to grep for data for between time frames in a day.
>
> >From the week data to get all data for a certain date i usually use
>
> $ grep '^03/.*/2003' <data file>
>
> BUT If I would like to see all data within a week between 10am and 14pm how
> can I do this?
>
> Can someone please help as I think have tried everything to my knowledge and
> understanding
>
> Any help will be greatly appreciated
>
> regards,
> gab
>
> _________________________________________________________________
> Find a cheaper internet access deal - choose one to suit you.
> http://www.msn.co.uk/internetaccess
>
> --
> Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> Archive     http://www.ee.ethz.ch/~slist/rrd-users
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


-- Attached file removed by Ecartis and put at URL below --
-- Type: text/plain
-- Size: 1k (1255 bytes)
-- URL : http://www.ee.ethz.ch/~slist/p/08-Disclaimer.txt


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list