---
name: "Lire::ImportJob"
section: "3pm"
platform: "linux"
package: "lire"
version: "2.1.1-8"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Lire::ImportJob"
---

# Lire::ImportJob(3pm)

Object used to represent an periodical source of log data

## NAME

Lire::ImportJob - Object used to represent an periodical source of log data

## SYNOPSIS

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

## DESCRIPTION

The Lire::ImportJob object is used to represent a source of log data. ImportJobs can also be instantiated from configuration data (The 'import\_job' configuration specification.)

## new( $name, ... );

Create a new Lire::ImportJob object. As mandatory parameter, it takes the name of the log source.

Additional parameters:

- pattern

  The path to the file that contains the log data. This filename can contain [**strftime**(3)](/strftime/3.md) patterns that will be substituted to obtain the name of the file. (Useful for automatic rotation).

- 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.

- 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 omitted, the default system encoding will be used.

### name()

Returns the name of this ImportJob.

### period( \[$new\_period\] )

With no argument, returns the period of this ImportJob. With a parameter, the ImportJob's period is set to this new value.

### file( \[$time\] )

Returns the file to be used. The optional `$time` parameter (which defaults to now) is used to compute the file name. To find the file to use for yesterday's data, one could pass time - 86400.

### pattern( \[$new\_file\] )

Returns the file pattern to use as log data source. This pattern may contain [**strftime**(3)](/strftime/3.md) 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 '' will not use a filter.

### encoding( \[$new\_encoding\] )

Returns the encoding of the log file. Undef and '' means 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).

### 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 setup properly.

### run( $store, \[$time\] )

Runs this ImportJob and import 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.

## SEE ALSO

[**Lire::DlfStore**(3pm)](/Lire::DlfStore/3pm.md) [**Lire::DlfConverter**(3pm)](/Lire::DlfConverter/3pm.md)

## AUTHOR

```
  Francis J. Lacoste <flacoste@logreport.org>
```

## VERSION

`$Id:` ImportJob.pm,v 1.14 2006/07/23 13:16:29 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.
