man Lire::DlfConverterProcess () - Object that controls the DLF conversion process

NAME

Lire::DlfConverterProcess - Object that controls the DLF conversion process

SYNOPSIS

  use Lire::ImportJob;
  use Lire::DlfStore;
  use Lire::DlfConverterProcess;

  my $src = new Lire::ImportJob( "file", 'pattern' => "/var/log/messages" );
  my $store = Lire::DlfStore->open( "store" );

  my $process = new Lire::DlfConverterProcess( $src, $store );

  $process->run_import_job();

  print "Log lines read: ",      $process->line_count(), "\n";
  print "DLF records created: ", $process->dlf_count,    "\n";
  print "Errors encountered: ",  $process->errors_count, "\n";
  print "Ignored records: ",     $process->ignored_count,"\n";

DESCRIPTION

This object encapsulates the Lire DLF conversion process. It takes as parameter a Lire::ImportJob and a Lire::DlfStore. It will setup the converter and will converter the content of Lire::ImportJob to DLF which will be saved in the Lire::DlfStore.

The object provides the API to the converter. Methods are also available to query information on the conversion process. Create a Lire::DlfConverterProcess that will be used to import the log specified in Lire::ImportJob into DLF records which will be stored into Lire::DlfStore.

run_import_job()

Import the log data from ImportJob as DLF. This method will throw an exception if it is called more than once.

job_id()

Returns the job identifier associated to this process.

dlf_store()

Returns the Lire::DlfStore in which this conversion process is storing the DLF records.

import_job()

Returns the Lire::ImportJob upon which this conversion process is operating.

line_count()

Returns the number of lines processed. This will 0 in case the DLF converter process file and not log lines. During a processing, this is always equals to the line that is currently being converted.

dlf_count()

Returns the number of DLF records created.

error_count()

Returns the number of errors encountered in the conversion process.

ignored_count()

Returns the number of records which were ignored in the conversion process.

saved_count()

Returns the number of lines which were saved for later processing.

API FOR THE DLF CONVERTERS

This is the object that encapsulates the Dlf implementation and hides the complexitity of the storage framework from the DLF converter. It offers the following methods to the DLf converter. This writes the CW$dlf DLF record conforming the CW$schema's schema in the Lire::DlfStore. The schema is the schema's name (e.g. 'www'). CW$dlf is an hash reference. Keys are the schema's field name. Undefined value means that this field isn't available in that record. Method that should be used to save CW$line for a future processing run of the converter on the same Lire::ImportJob. Method that can be used by the Lire::DlfConverter to report that the '$line' log line was ignored during that processing. The reason why the line was ignored can be given in CW$reason. For example, syslog-based converter should use that method to report lines that are for another 'service' than theirs. Method that should be used by the Lire::DlfConveter to report that an error was encountered when processing the Lire::ImportJob. CW$error_msg should be used to report the nature of the error. The CW$line parameter should be used by converter operating on lines to associate the error message to a particular line.

SEE ALSO

AUTHOR

Francis J. Lacoste <flacoste@logreport.org>

VERSION

$Id: DlfConverterProcess.pm,v 1.15 2004/06/07 16:42:04 flacoste Exp $

COPYRIGHT

Copyright (C) 2002-2004 Stichting LogReport Foundation LogReport@LogReport.org

This file is part of Lire.

Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.