#!/usr/bin/perl -w $path1 = "/home/tsec/testwatch/attackerresult.log"; $attacker = ">>/home/tsec/testwatch/attacker.csv"; #$path2 = #$path3 = #$path4 = #function definition #Pattern for attackerlog only sub extractor(){ open(LOG, $path1) or die "Cant't open '$path1': $!"; open(FILE, $attacker) or die "Can't open '$attacker': $!"; $target = "tcp"; while(){ if(/$target/){ print FILE $target . "\n"; } } } close(LOG); close(FILE);