mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
calamaris: Make decompressing large logs more memory-friendly.
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).
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user