#!/usr/bin/perl -w use strict; my $log = './log'; my @data; # Open the firewall log file and create new array containing all of the data. open (LOG, $log) or die "Can't open $log: $!"; while (){ push (@data, "$_"); } # Split the @data array into separate arrays by category. my (@dst, @service); foreach (@data) { my @lines=split "\n",$_; foreach(@lines){ my ($num,$date,$time,$fw,$type,$action,$alert,$int,$dir,$proto,$src,$dst,$service,$sport,$len,$rule) = (split /;/,$_); push(@dst, $dst); push(@service, $service); } }