ImportJob(3pm)

๐Ÿ“ฆ version 2.1.1, in arch rolling

๐Ÿ’… ImportJob(3pm) โ€” like, the whole vibe

Okay bestie, so this is a page from LogReport's Lire Documentation โ€” it's Lire::ImportJob(3pm) and it's literally the object that represents a periodical source of log data. Yes, that's the whole point of it. Let's go ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

Lire::ImportJob โ€” the object we use to represent a periodical source of log data. That's it, that's the job. ๐Ÿ’–


โœจ SYNOPSIS โœจ

  use Lire::ImportJob;

  my $src = new Lire::ImportJob( "name",
                                 'pattern'    => "/var/log/messsages",
                                 'period'     => "unique",
                                 'processor'  => $name,
                                );

  my $file = $src->file,

(yes, that trailing comma is in the original, do not come for me ๐Ÿ™ˆ)


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So the Lire::ImportJob object is used to represent a source of log data. And here's the cute part: ImportJobs can also be instantiated from configuration data โ€” specifically, the 'import_job' configuration specification. Slay. โœจ


๐Ÿ’ซ new( $name, ... );

Creates a brand-new Lire::ImportJob object. As a mandatory parameter, it takes the name of the log source. You literally cannot skip it, bestie.

Additional parameters, in the order they show up:

  • pattern โ€” the path to the file that contains the log data. This filename can contain strftime(3) patterns that get substituted to obtain the actual name of the file. Super useful for automatic rotation, no cap. ๐Ÿ”ฅ
  • period โ€” the periodicity to which this ImportJob should be processed. Defaults to 'unique', which means this is a one-shot ImportJob. Other recognized values are 'hourly', 'daily', 'weekly', 'monthly' and 'yearly'.
  • converter โ€” the name of the converter that can be used to process the ImportJob. This must be known to the Lire::PluginManager. (iykyk)
  • converter_config โ€” configuration parameter for the DlfConverter.
  • filter โ€” a shell command that will be used to filter the log file.
  • encoding โ€” encoding for the log file. If you omit it, the default system encoding is used.

๐ŸŽ€ name()

Returns the name of this ImportJob. Simple. Elegant. Iconic.


๐ŸŽ€ period( [$new_period] )

With no argument, returns the period of this ImportJob. With a parameter, the ImportJob's period gets set to this new value. Both ways work, pick your fighter. ๐Ÿ’…


๐ŸŽ€ file( [$time] )

Returns the file to be used. The optional $time parameter (which defaults to now) is used to compute the file name. So if you wanted to find the file to use for yesterday's data, you could pass time - 86400. Math! ๐Ÿงฎโœจ


๐ŸŽ€ pattern( [$new_file] )

Returns the file pattern to use as log data source. This pattern may contain strftime(3) substitutions. If an argument is used, it will change the file to use.


๐ŸŽ€ filter( [$new_filter] )

Returns the shell command that will be used as filter. undef or '' means no filter will be used. (So like, no filter, no problem ๐Ÿซถ)


๐ŸŽ€ encoding( [$new_encoding] )

Returns the encoding of the log file. undef and '' mean to use the system default encoding.


๐ŸŽ€ converter( [$new_name] )

Returns the name of the converter that should be used for this ImportJob.


๐ŸŽ€ converter_config( [$new_config] )

Returns a configuration object that should be used by the DlfConverter (through the set_configuration() method). Fancy. ๐Ÿ‘‘


๐ŸŽ€ log_fh( [ $time ] )

Returns a file handle that can be used to read from the log. $time is the parameter taken by file to determine the final filename. All filters and encoding will be set up properly for you. We love a method that handles the boring stuff. ๐Ÿ’–


๐ŸŽ€ run( $store, [$time] )

Runs this ImportJob and imports it into the $store DlfStore. The $time parameter will be used to determine the time window covered by period. It defaults to the current time. Go little ImportJob, go! ๐Ÿ”ฅ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ


๐ŸŒˆ AUTHOR ๐ŸŒˆ

Francis J. Lacoste <flacoste@logreport.org>


โญ VERSION โญ

$Id: ImportJob.pm,v 1.14 2006/07/23 13:16:29 vanbaal Exp $


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.


ngl, that's the whole page. Every flag, every default, every method โ€” nothing skipped, periodt. ๐Ÿ’…

And that's a wrap, bestie โ€” this was Lire 2.1.1, dated 2025-09-28, and yes, it's still ImportJob(3pm) at the end of the day. Catch you in the next manpage! ๐Ÿฆ‹๐ŸŽ€๐Ÿ’–

๐Ÿ“ฆ where this page comes from