LIRE::DLFCONVERTERPROCESS(3pm)
π NAME
Lire::DlfConverterProcess β the object that runs the whole DLF conversion process, like the backstage manager of your log-import era π
β¨ SYNOPSIS β¨
use Lire::ImportJob;
use Lire::DlfStore;
use Lire::DlfConverterProcess;
my $src = new Lire::ImportJob( "file", 'pattern' => "/var/log/messages" );
my $store = new 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";
That's the whole vibe, bestie β roughly eight lines and you've read a whole log file into DLF β¨
πΈ DESCRIPTION πΈ
Okay so picture this: this object encapsulates the entire Lire DLF conversion process. It takes a Lire::ImportJob and a Lire::DlfStore as its parameters, sets up the converter, and then converts the content of the Lire::ImportJob to DLF β which then gets saved into the Lire::DlfStore. It's giving β¨glow-up pipelineβ¨.
The object also hands your converter the API it needs, plus a bunch of methods for querying info about how the conversion went. Literally the whole package π
π new( $job, $store );
Creates a Lire::DlfConverterProcess that you'll use to import the log specified in Lire::ImportJob into DLF records, which get stored into Lire::DlfStore. Main character constructor energy fr fr π«Ά
π run_import_job( [$time] )
This is the one that actually does the thing β it imports the log data from ImportJob as DLF.
β οΈ Heads up bestie: this method will throw an exception if you call it more than once. One and done, periodt.
The $time parameter is used to determine the time window covered by period. It defaults to the current time β so if you don't say anything, it just assumes now π
π job_id()
Returns the job identifier associated to this process. Your little name badge π
π dlf_store()
Returns the Lire::DlfStore where this conversion process is storing the DLF records. That's the home address π
π import_job()
Returns the Lire::ImportJob that this conversion process is operating on. The source material, iykyk π
π line_count()
Returns the number of lines processed.
π«Ά Real talk: this will be 0 in the case where the DLF converter processes a file and not log lines. And during processing, this always equals the line that is currently being converted. Live tracking, no cap.
π dlf_count()
Returns the number of DLF records created. Slay-count π
π error_count()
Returns the number of errors encountered in the conversion process. Hopefully 0, but likeβ¦ log files π
π ignored_count()
Returns the number of records which were ignored in the conversion process. They're not mad, they just didn't make the cut π
π saved_count()
Returns the number of lines which were saved for later processing. Saving them for their own little comeback arc π
π API FOR THE DLF CONVERTERS π
This is the object that encapsulates the Dlf implementation and hides all the complexity of the storage framework from the DLF converter. It offers these methods to the DLF converter:
π¦ write_dlf( $schema, $dlf )
Writes the $dlf DLF record, conforming to the $schema's schema, into the Lire::DlfStore. The schema is the schema's name (e.g. 'www'). $dlf is a hash reference β the keys are the schema's field names. An undefined value means that this field isn't available in that record. Ghosted fields, basically π»
π¦ save_log_line( $line )
The method you should use to save $line for a future processing run of the converter on the same Lire::ImportJob. Not goodbye, just see-you-later π₯²
π¦ ignored_log_line( $line, [ $reason ] )
The method a Lire::DlfConverter can use to report that the '$line' log line was ignored during that processing. You can pass in why it got ignored via $reason.
π For example: syslog-based converters should use this method to report lines that belong to a different 'service' than theirs. Not their circus, not their monkeys πͺ
π¦ error( $error_msg, [ $line ] );
The method a Lire::DlfConveter should use to report that an error was encountered while processing the Lire::ImportJob. Use $error_msg to report the nature of the error. And the $line parameter should be used by converters operating on lines, to associate the error message with one particular line. Receipts, basically π§Ύ
π₯ SEE ALSO
Lire::DlfStore(3pm) Β· Lire::DlfConverter(3pm)
Go read those next, bestie, they're the supporting cast π«Ά
π AUTHOR
Francis J. Lacoste <flacoste@logreport.org>
β VERSION
$Id: DlfConverterProcess.pm,v 1.18 2006/07/23 13:16:28 vanbaal 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.
Okay that's the whole page, bestie β written for Lire 2.1.1, dated 2025-09-28, on the DlfConverterProcess(3pm) manual page. Go convert some logs, you absolute icon π
β¨
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms