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, 11 years and 40 days ago. Viewed 1,420 times. #1
[edit] [rdf]
labels
attachments

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:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt