For When You Can't Have The Real Thing
[ start | index | login ]
start > dave > experiments > Net Flows > 2007-11-06 > 1

2007-11-06 #1

Created by dave. Last edited by dave, 16 years and 167 days ago. Viewed 2,505 times. #1
[edit] [rdf]

Messing with dates today.

Input: a file name ft-v05.2007-10-22.204501-0400

use Date::Parse;
$file =~ /(....-..-..).(..)(..)(..)(.....)/;
$date="$1 $2:$3:$4 $5";
$timeStamp = str2time($date);

Gets us the epoch-based time that this file represents. Of course the interesting thing here is that the time represents the start of the time period, not the end, so if we treat this as the "end" mark of the data flows represented within, we are moving some data into the past and artificially compressing some of it.

Also by default the flow capture files are fifteen minutes long, not five as rrdtool will want.

So I now can import large swaths of data into my postgres database.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt