Skip to main content

Parámetros de configuración

El plugin se configura mediante un fichero de configuración externo. Este archivo de configuración tiene una serie de parámetros «generales» , una serie de parámetros específicos para cada registro, y un conjunto de parámetros específicos para cada bloque de expresión regular.

Parametros generales

  • include
    Hace una llamada a otro fichero de configuración. Se puede anidar sin límite, y su orden de carga es secuencial.
    Es importante llamar a ficheros con rutas absolutas.
  • index_dir
    Utiliza este directorio para almacenar los archivos de índice. El plugin debe poder escribir y leer en el directorio
  • logfile
    Archivo de registro del plugin.

Parametros específicos de log

  • log_begin y log_end
    SetEstablecer marksmarcas ofde theinicio beginningy andfin endde ofla adefinición filede definitionun archivo logparser.log
  • log_module_name
    ModuleNombre namedel generatedmódulo bygenerado thepor el plugin.
  • log_type
    LogTipo modulede type,módulo cande beregistro, ofpuede threeser types:de tres tipos:
    - return_ocurrences:return_ocurrencias: ReturnsDevuelve aun numericdato datanumérico withcon theel numbernúmero ofde occurrences.ocurrencias.
    - return_lines: ReturnsDevuelve thelas líneas del log linesque that do match.coinciden.
    - return_message: ReturnsDevuelve aun messagemensaje specifiedespecificado bypor theel configurationfichero filede configuración
  • log_rotate_mode
    CanPuede beser ofde tipo inode typeo ormd5. md5Este type.es Thisel istipo thede typedetección detectionse isrealiza donepara tosaber knowsi ifun aregistro logse isrota rotated oro
    not.no.
  • log_force_readall
    WhenCuando thiseste token isestá present,presente, theel analizador de logs procesa todo el log parserdesde processesel allprincipio thesi logno fromlo theha beginninghecho ifya
    (Es youla haveprimera not
    alreadyvez doneque (Isse theabre firsto timedetecta Iuna opened or detects a rotation)rotación). NOTE:NOTA: YouPuede cangenerar generategrandes largevolúmenes de datos
    volumes of data.
  • log_location_exec
    ExecutesEjecuta theel specifiedcomando commandespecificado topara obtainobtener theel namenombre (absoluteruta path)absoluta) filedel toarchivo bea processed.procesar.
  • log_location_filename
    SpecificEspecifica theel lognombre namedel archivo de registro (absoluteruta path)absoluta) filea to process.procesar.
  • log_location_multiple
    GivePermite youespecificar aun wayarchivo too specifyvarios aarchivos fileutilizando orun serveralcomodín, filespor by using a wildcard, for example:ejemplo:
    /tmp/apache/file_log*
    oro
    /tmp/system*/mail*
    UsedUsado inen combinationcombinación withcon log_create_module_for_each_log itcreará willun createmódulo adiferente differentpor modulecada perfichero de registro
    logfileo orpondrá puttoda allla theinformación informationde fromdiferentes differentficheros filesen inel themismo same module.módulo.
  • log_create_module_for_each_log
    IfSi usedse withutiliza “log_location_multiple”con will«log_location_multiple» forceforzará theal plugin to generate a differentgenerar moduleun formódulo each
    logfile.diferente para cada archivo de registro de logs.

Definicion de expresiones regulares

Para entender cada elemento, a continuación se muestra un ejemplo de fichero de configuración.

# Include, to load extenal/aditional configuration files
# include /tmp/my_other_configuration.conf

# Directory where temporal indexes will be stored (/tmp by default)
#index_dir /tmp

# Log problems with the logparser, (/tmp/pandora_logparser.log by default)
#logfile /tmp/pandora_logparser.log

# Sample of a single log match
log_begin
log_module_name Weekly
log_location_file /var/log/weekly.out
log_description Errors cannot find
log_type return_lines
log_regexp_begin
log_regexp_rule output
log_regexp_severity WARNING
log_return_message Cannot find process to run
log_regexp_end
log_end

# Sample of wildcard matching of several logfiles within the same module
log_begin
log_rotate_mode md5
log_module_name system_log
log_force_readall
log_location_multiple /var/log/system.log*
log_description Errors cannot find
log_type return_lines
log_regexp_begin
log_regexp_rule Cannot
log_regexp_severity WARNING
log_return_message Cannot find process to run
log_regexp_end
log_end

# Sample of several wildcard matching on the same file
log_begin
log_module_name hits_apache
log_location_file /var/log/apache2
log_description Access log from Apache, we will get the integria access
#log_create_module_for_each_log
log_type return_ocurrences
log_regexp_begin
log_regexp_rule Error -($1)\-($2) [0-9a-zA-Z]*
log_regexp_severity WARNING
log_return_message Otro bonito texto de error
log_regexp_end
log_regexp_begin
log_regexp_rule File\sdoes\snot\sexist
log_regexp_severity WARNING
log_regexp_end
log_regexp_begin
log_regexp_rule pandora_backend\.html
log_regexp_severity WARNING
log_return_message Something possible harmful happen
log_regexp_end
log_end

# Sample of wildcard matching of several logfiles with diferent dynamic modules
log_begin
log_rotate_mode inode
log_module_name test_log
log_force_readall
# If enabled, this token will create a different module using the module_name
# provided plus the full logfilename replacing / with " ".
log_create_module_for_each_log
log_location_multiple /tmp/log*/hola*
log_description Errors cannot find
log_type return_lines
log_regexp_begin
log_regexp_rule adios
log_regexp_severity WARNING
log_return_message Cannot find process to run
log_regexp_end
log_end