>
> ($left,$right) = split(/word/, $sentence);
>
I am trying this but its not working. Im lost :)
could someone take a look...
This is the beggining of a scrip to make reports
based on droped iptable packets
thanks
jd
#################################################
#!/usr/bin/perl -w
$file = '/var/log/messages';
open(FILE, "$file") || die "cant open messages";
@log = <FILE>;
close(FILE);
## get lines from Messages for iptables - IPT
foreach $log (@log){
if($log =~ /IPT/){
push(@ipts, "$log");
}
}
## get lines for the 31st
foreach(@ipts){
@good = split(" ", $_);
if($good[1] == 31){
push (@finale, "$_");
}
}
## get offending ports
foreach(@finale){
@broken = split(" ", $_);
foreach $field(@broken){
if($field =~ /DPT/){
push(@stuff, $field);
}
}
}
## @stuff vars look like --- DPT=80 DPT=1433 etc...
foreach(@stuff){
(@trash,@good) = split(/DPT\=/, $_);
}
foreach(@good){
print;
}
thanks,
jd
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]