Brian i need help again, i tried your way alone and several other ways, it all worked out, but after i put it in my program, it kept telling me "could not extract info", anyway, below is my program.
the program first extract the file into paragraphs, and then it split the paragraph into lines. then extract the the lines.
the actual file is shown below the program
==========================================================
$file = 'sampleAlertfile'; # Name the file
open FILE, $file; # Open the file
#################################################
#find each paragraph and save them into a file
#################################################
local $/ = "\n\n";
my $paragraph;
$indexOfParagraph = 0;
while ($paragraph = <FILE>) {
chomp $paragraph;
my @lines=split(/\n/,$paragraph);
#print $indexOfParagraph;
print $lines[3];
#########################################
#find alert type
#########################################
$lookfor=("[**]");
my $ipaddr=qr/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
if ($line[0]=~/^\s*($ipaddr)\s+->\s+($ipaddr)\s+(\S+)\s+TTL

\d+)\s+TOS

\S+)\s+ID

\d+)\s+IpLen

\d+)\s+DgmLen

\d+)\s*$/){
print "$1,$2\n";
$source_IP[$indexOfParagraph]=$1;
$Destination_IP[$indexOfParagraph]=$2;
$protocol[$indexOfParagraph]=$3;
$TTL[$indexOfParagraph]=$4;
$TOS[$indexOfParagraph]=$5;
$ID[$indexOfParagraph]=$6;
$IPLen[$indexOfParagraph]=$7;
$DmgLen[$indexOfParagraph]=$8
}
else{
print "Could not extract values\n";
}
print @source_IP;
$indexOfParagraph++;
}#end of while loop
close(FILE);
===========================================================
[**] [1:483:5] ICMP PING CyberKit 2.2 Windows [**]
[Classification: Misc activity] [Priority: 3]
09/19-13:35:41.644975 0:3:6C:A8:44:0 -> 0:11:11:5A:F0:9C type:0x800 len:0x4A
111.11.111.111 -> 111.111.111.111 ICMP TTL:127 TOS:0x0 ID:24623 IpLen:20 DgmLen:60
Type:8 Code:0 ID:512 Seq:38080 ECHO
[Xref =>
]
[**] [1:1411:10] SNMP public access udp [**]
[Classification: Attempted Information Leak] [Priority: 2]
09/19-13:37:16.503268 0:F:3D:1:2B:4A -> 0:4:0:5D:FD:35 type:0x800 len:0x78
111.111.111.111:61813 -> 111.111.111.111:161 UDP TTL:127 TOS:0x0 ID:9446 IpLen:20 DgmLen:106
Len: 78
[Xref =>
][Xref =>
][Xref =>
][Xref =>
][Xref =>
][Xref =>
]