Hi,
I think this is why recovering logs doesn't work:
RCS file: /cvsroot/bandwidthd/bandwidthd/bandwidthd.c,v
retrieving revision 1.57
diff -u -r1.57 bandwidthd.c
--- bandwidthd.c 16 Jun 2011 19:34:56 -0000 1.57
+++ bandwidthd.c 25 Jul 2013 18:40:52 -0000
@@ -824,7 +824,7 @@
HostIp2CharIp(IPData->ip, IPBuffer);
fprintf(cdf, "%s,%lu,", IPBuffer, IPData->timestamp);
Stats = &(IPData->Send);
- fprintf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu", Stats->total, Stats->icmp, Stats->udp, Stats->tcp, Stats->ftp, Stats->http, Stats->mail, Stats->p2p);
+ fprintf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,", Stats->total, Stats->icmp, Stats->udp, Stats->tcp, Stats->ftp, Stats->http, Stats->mail, Stats->p2p);
Stats = &(IPData->Receive);
fprintf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu\n", Stats->total, Stats->icmp, Stats->udp, Stats->tcp, Stats->ftp, Stats->http, Stats->mail, Stats->p2p);
}
you were missing a ',' on the output of Stats->p2p from the Send data, which concatenated the value to the receive Stats->total values. I was seeing 17 columns in my .cdf files, instead of the expected 18 (IP, timestamp, 8x send, 8x receive).
If you have bad .cdf files with 17 columns, you can run the following script to repair the data. Specify the .cdf file as an argument, and redirect the output to a new file.
./parse.py old/log.1.0.cdf > log.1.0.cdf