]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
calamaris: Make decompressing large logs more memory-friendly.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Jul 2012 12:06:47 +0000 (14:06 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Jul 2012 12:06:47 +0000 (14:06 +0200)
Thanks to Roger Devaux for reporting and testing.

Calamaris is now able to process big log files consuming about
10M or RAM (was several gigabytes before).

config/calamaris/mkreport
config/rootfiles/core/61/filelists/files

index 53db9d5715d3c4cc064ad218267f2420b32213df..ee831624cc5d750a9797b9ed334f34b7682382c3 100644 (file)
@@ -94,7 +94,7 @@ sub processlogfiles
                {
                        if ($filestr =~ /access\.log/) {
                                open (LOG,"gzip -dc $filestr |");
-                               foreach (<LOG>) {
+                               while (<LOG>) {
                                        if (substr($_,0,10) >= $date_from) { if (substr($_,0,10) <= $date_to) { print TMPLOG "$_"; } }
                                }
                                close(LOG);
@@ -106,7 +106,7 @@ sub processlogfiles
        {
                if ($filestr =~ /access\.log/) {
                        open (LOG,$filestr);
-                       foreach (<LOG>) {
+                       while (<LOG>) {
                                if (substr($_,0,10) >= $date_from) { if (substr($_,0,10) <= $date_to) { print TMPLOG "$_"; } }
                        }
                        close(LOG);
index 396a27f7a8cd80b1d83893486e33c9f9571b419d..1466fef82ec254c0e90e60e79cbf3db09c14e255 100644 (file)
@@ -8,5 +8,6 @@ srv/web/ipfire/cgi-bin/ovpnmain.cgi
 srv/web/ipfire/cgi-bin/proxy.cgi
 var/ipfire/general-functions.pl
 var/ipfire/langs
+var/ipfire/proxy/calamaris/bin/mkreport
 usr/local/bin/getconntracktable
 usr/sbin/redirect_wrapper