in reply to Re: Efficient Way to Parse a Large Log File with a Large Regex
in thread Efficient Way to Parse a Large Log File with a Large Regex
I'm then calling it liks so:use warnings; use strict; my @ips = qw/192.168.2.1 ..../; @ips = map { quotemeta } @ips; my $regex = join('|', @ips); my $re = qr[$regex]; while (<>) { print if /$re/; }
It's taking up quite a bit of resources, but not bringing the server to it's knees.tail -f fw.log | /usr/local/scripts/parseips
|
|---|