in reply to Automating Firewall Log Reporting

# switch to check if we've reached the topten list yet. my $topten = 0; my @ips; open REPORT, "reportfile" or die "Can't open reportfile: $!\n"; while (<REPORT>) { chomp; $topten = 1 if m!^Users/Source Addresses!; next unless $topten; push @ips, [ split /\s+/ ] if /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3 +})/; } close REPORT;

That's basically the gist of it. Every element in @ips is a reference to an anonymous array; the first element of the anonyous array is the ip address, the second element is that number thingy (whatever it signifies) and the third is the percentage.

For further study, look into MIME::Lite (for mailing) and Net::Whois (for you-know-what).

Of course, it would probably be easier to just modify the script that generates this output

Hope this helps,



ar0n ]

Replies are listed 'Best First'.
Re: (ar0n) Re: Automating Firewall Log Reporting
by dru145 (Friar) on Jul 18, 2001 at 20:36 UTC
    ar0n,

    Thanks for taking time out to help me. When I throw in a:

    print "@ips\n";
    to see what data I get, I get the following output:
    ARRAY(0x8101f68) ARRAY(0x81052b0) ARRAY(0x81052ec) etc.

    Do you know what I am doing wrong?

    Thanks, Dru

      I figured it out. Since this a multidimensional array, I have to pull my data out as such:
      $ips[0][0], $ips[1][0], $ips[1][1], etc.

      There's nothing like figuring something out yourself.