DlfConverter(3pm)

πŸ“¦ version 2.1.1, in arch rolling

πŸ’… DlfConverter(3pm) β€” the glow-up

ok so this is DlfConverter, straight out of LogReport's Lire Documentation, and honestly? it's giving base-class energy in the best way possible. it's the blueprint bestie, the template, the moment before the actual converter shows up ✨

🌸 NAME 🌸

Lire::DlfConverter β€” the base interface of all DLF converters. like, every single one. the mother of converters. the blueprint. the moment. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

  use base qw/ Lire::DlfConverter /;

that's it. that's the whole vibe check. you inherit from it, that's literally the assignment πŸ’œ


✨ DESCRIPTION ✨

okay so listen. this package defines the interface that every last DLF Converter has to implement. it's the group chat rules, basically β€” everyone who joins has to follow them.

and here's the tea: all the methods defined in this package will throw a 'method not implemented' exception if you call them. every single one. no cap. so if you try to use this bad boy directly it's gonna yell at you 😭 it's a base class, not a plug-and-play situation.


πŸŽ€ META INFORMATION METHODS πŸŽ€

these are the methods that feed info to the Lire framework about the DLF converter. the little biography section of the converter's profile, if you will πŸ’…

πŸ“ name()

returns the name of the DLF converter β€” i.e. the service's name (aka the log format name).

E.g. "combined"

🌈 title()

returns a more human friendly name for the DLF Converter. like the display name, the one you'd put on the little name tag 🫢

E.g. "Combined Log Format DLF Converter"

🧚 description()

returns a DocBook XML based documentation of the DLF Converter. yes, XML. it's giving old school but we respect it ✨

E.g. <para>This DLF converter can be used to process log file in the Combined Log Format to the www DLF schema.</para>

πŸ‘‘ schemas()

returns a list of DLF schemas for which DLF records can be written from the data contained in the log file. like, "here's what I can output to, bestie" πŸ’–

E.g. for the combined DLF converters, that would be 'www'.

for the 'nms' converter that could be "qw/daemon email/" β€” which means the DLF converter writes DLF records in the hypothetical "daemon" schema (server start, stops, restarts, etc.) and the email schema. multi-talented tbh.

⚠️ this should only contain 'base' (aka superservice) schemas. no extended or derived schema's name should appear in that list. those are reserved for the analyzers, periodt. don't be out here claiming schemas that aren't yours πŸ™ˆ

πŸ’€ handle_log_lines()

this method should return true if the DlfConverter processes line-oriented log file. that's the default, and honestly it's the most common situation.

but if it returns false? then only the process_log_file() method will be called. otherwise the process_log_line() method is used for every input line. choose your fighter πŸ₯Š


🌸 Implementation methods 🌸

these are the methods where the actual DLF converter work happens. the main character methods, if you will πŸ’…

here's the sequence, and it's a whole choreography:

  • init_dlf_converter() gets called once before any processing occurs.
  • afterwards, process_log_line() gets called once for every line that was marked for log continuation, and for every line contained in the log file.
  • finish_conversion() gets called once all lines are processed.
🚨 and heads up: any exceptions (uncaught die) that occur during any of these methods will abort the conversion process. no recovery arc. it's done. 😭

🫢 init_dlf_converter( $process, [$config] )

the framework calls this before processing the log file. it's your converter's "get ready with me" moment β€” use it to initialize its state ✨

  • $process β€” contains the Lire::DlfConverterProcess object which is controlling the conversion process. the manager. the one in charge πŸ‘‘
  • $config β€” contains configuration data that was specified in the ImportJob for that converter. to register configuration specification for your DlfConverter, you just need to define a configuraiton specification under the name converter_name_properties (yes, that's how it's spelled in the source, we don't fix, we respect πŸ’€). this should be either a RecordSpec or ObjectSpec.

πŸ¦‹ process_log_file( $process, $fd )

this method is called so that the converter can convert the data contained in the $fd file handle to DLF. this one is only used when the handle_log_lines() method returned false β€” so like, the non-line-oriented path πŸ›£οΈ

$process contains a reference to the Lire::DlfConverterProcess object which controls the conversion process and defines the API to write DLF and report errors. it's your whole toolbox fr fr.

⭐ process_log_line( $process, $line )

the framework calls this once for each log line present in the log file. and it's only called if the handles_log_lines() method returnes true πŸ’–

  • $process β€” a reference to the Lire::DlfConverterProcess object. this object defines a method to report errors, save lines for continuation purposes, and writes DLF records. the whole toolkit, iconically.
  • $line β€” contains the log line which should be processed, with the end of line removed. no trailing newline shenanigans, it's already handled πŸŽ€

πŸ“ finish_conversion( $dlf_store )

called once by the framework, once all log lines were processed. the closing ceremony 🌟 it can be used by the converter to write any DLF records that could be remaining because of a stateful analysis. you know, the stragglers. the leftover lore. write them out before you leave πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group honestly:


πŸ’– AUTHOR πŸ’–

Francis J. Lacoste <flacoste@logreport.org> β€” the icon who wrote this. we stan 🫢


πŸŽ€ VERSION πŸŽ€

$Id: DlfConverter.pm,v 1.12 2006/07/23 13:16:28 vanbaal Exp $

Copyright (C) 2002, 2003, 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. no promises bestie, it's a licence thing 😭

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!! πŸ’…βœ¨ and for the little sign-off credits: this gorgeous piece of documentation is from Lire 2.1.1, and it was last touched on 2025-09-28. slay, date-stamped, immortalised πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from