2007-11-16 16:04:33 Local1.Alert 128.29.29.40 id=firewall time="2007-11-16 16:04:08" fw=WS2000-Store 29 pri=1 proto=6(tcp) src=128.29.29.200 dst=128.29.100.102 mid= 1013 mtp= 2 msg=TCP connection request received is invalid, dropping packet Src 23 Dst 4412 from EXT n/w agent=Firewall
2007-11-16 16:05:05 Local1.Alert 128.24.24.40 id=firewall time="2007-11-16 16:03:25" fw=WS2000-Store 24 pri=1 proto=6(tcp) src=128.24.24.200 dst=128.24.100.101 mid= 1013 mtp= 2 msg=TCP connection request received is invalid, dropping packet Src 23 Dst 4344 from EXT n/w agent=Firewall
2007-11-16 16:05:34 Local1.Alert 128.29.29.40 id=firewall time="2007-11-16 16:05:09" fw=WS2000-Store 29 pri=1 proto=6(tcp) src=128.29.29.200 dst=128.29.100.102 mid= 1013 mtp= 2 msg=TCP connection request received is invalid, dropping packet Src 23 Dst 4412 from EXT n/w agent=Firewall
2007-11-16 16:05:39 Local1.Alert 128.2.2.40 id=firewall time="2007-11-16 16:03:36" fw=WS2000-Store 02 pri=1 proto=6(tcp) src=128.2.2.200 dst=128.2.100.106 mid= 1013 mtp= 2 msg=TCP connection request received is invalid, dropping packet Src 23 Dst 4631 from EXT n/w agent=Firewall
2007-11-16 16:05:40 Local1.Alert 128.2.2.40 id=firewall time="2007-11-16 16:03:36" fw=WS2000-Store 02 pri=1 proto=6(tcp) src=128.2.2.200 dst=128.2.100.106 mid= 1013 mtp= 2 msg=TCP connection request received is invalid, dropping packet Src 23 Dst 4631 from EXT n/w agent=Firewall
2007-11-16 16:05:40 Local1.Alert 128.2.2.40 id=firewall time="2007-11-16 16:03:37" fw=WS2000-Store 02 pri=1 proto=6(tcp) src=128.2.2.200 dst=128.2.100.106 mid= 1013 mtp= 2 msg=TCP connection request received is invalid, dropping packet Src 23 Dst 4631 from EXT n/w agent=Firewall
####
#!perl
use strict;
open INPUT,"<","input_file.txt"||die "Can not open input_file: $!\n";
open CSV,">","OUTPUT.csv"||die "Can not open OUTPUT.csv: $!\n";
print CSV "Date,Time,WS 2000,FW Date,FW Time,Store,Src IP,Src Port,Dst IP,Dst Port,Type,Agent\n";
while(){
my @line = split /\s+/;
my $Date = $line[0];
my $Time = $line[1];
my $ws2k = $line[3];
my $FW_Date = $line[5];
my $FW_Time = $line[6];
my $store = $line[8];
my $src_ip = $line[11];
my $dst_ip = $line[12];
my $src_prt = $line[$#line - 6];
my $dst_prt = $line[$#line - 4];
my $type = $line[$#line - 2];
my $agent = $line[$#line];
chomp $agent;
$agent=~s/agent=//;
$FW_Date=~s/time="//;
$FW_Time=~s/"//;
$src_ip=~s/src=//;
$dst_ip=~s/dst=//;
print CSV "$Date,$Time,$ws2k,$FW_Date,$FW_Time,$store,$src_ip,$src_prt,$dst_ip,$dst_prt,$type,$agent\n";
}
close INPUT;
close CSV;
##
##
while(){
$_=~m/msg=(.*) Src/;
my $msg=$1;
my @line = split /\s+/;
## rest of code