lazyreader has asked for the wisdom of the Perl Monks concerning the following question:
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\" "); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing large File remotely
by Corion (Patriarch) on Jan 28, 2010 at 17:43 UTC | |
|
Re: Parsing large File remotely
by JavaFan (Canon) on Jan 28, 2010 at 18:01 UTC |