The above code works well for smaller log files but fails over large file sizes. other approach was to copy the file locally and perform parsing, which is not possible due to server restriction to establish FTP session. Hence I need to know any other alternative for my problem. Thanks.my $cmd="cat $logName"; @content = $self->{conn}->cmd($cmd); unless ( @content = $self->{conn}->cmd($cmd)){ $logger->error(__PACKAGE__ . ".$sub_name: Failed to execute th +e shell command:$cmd "); $logger->debug(__PACKAGE__ . ".$sub_name: <-- Leaving Sub [0]" +); return 0; for my $i ( 0 .. $#{$parseLogData{$_}}) { my $parseString = $parseLogData{$_}[$i]; my $flag = 0; if (@line = grep{/\Q$parseString\E/i} @content) { $logger->debug(__PACKAGE__ . ".$sub_name: PARSE SUCCESS: Expec +ted -> \"$parseString\" in \"$logName\": Count of Matches -> $#line") +; $flag = 1; } else { $logger->debug(__PACKAGE__ . ".$sub_name: PARSE FAILED: Expect +ed :: -> \"$parseString\" in \"$logName\" "); } }
In reply to Parsing large File remotely by lazyreader
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |