Skip to main content

Configuration Parameters

Configuration Parameters

The plugin receives all parameters directly via the command line:

advlogparserpandora_logparser [--idx-dir <dir>] <log_dirpath> [<name_regex>] [<content_regex>] [<source_type>]options]

Important: Always quote parameters containing *, ?, | or other shell metacharacters. Example: '*.log', '(?i)error'.

General Parameters

ParameterDescription
--idx-dirDirectory where index files are stored. The plugin must be able to read and write in this directory. Default: /tmp.

Log-Specific Parameters

Required
ParameterDescription
log_dir *Directory containing the log files to process. All files in the directory are listed and filtered using name_regex.
name_regex--name-regexRegular expression to filter file names within the directory.names. Default: .* (all files).
content_regex--content-regexRegular expression to filter lines within the log content. Only matching lines are included in the output. Default: .* (all lines).
source_type--source-typeValue of the <source> field in the generated log module. Identifies the data source in Pandora FMS.
--idx-dirDirectory ifwhere youindex expectfiles toare generatestored. modules.Default: /tmp.

* Required parameter.

Regular Expression Examples

File name filter (name_regex):

.*\.log              → only files with .log extension
access.*\.log        → files starting with "access" and ending in ".log"
(app|sys)\.log       → files named "app.log" or "sys.log"

Content filter (content_regex):

(?i)error                → lines containing "error" (case-insensitive)
(?i)error|critical|fail  → lines containing error, critical, or fail
^ERROR                   → lines starting with ERROR
[0-9]{3}\s               → lines containing a 3-digit code followed by a space