Logfile:onNewLinewithPatternFile

Method

Purpose

This method (on all platforms) applies the patterns from the pattern file to a new line from the log file. It returns the matching severity and pattern from the pattern file and the new line from the log file. The pattern file contains patterns that are used to match relevant log file entries. The pattern file is used as a filter to determine which lines are returned to the subscriber.

The first time this method is invoked, the previousLine field will be blank. On s subsequent invocations, the previousLine field will contain the value of the nextLine field of the previous method invocation.

Type

Asynchronous, IMPACT_INFO.

Arguments

 

Name

Type

Description

Logfile

String

The log file to be monitored.

Back quoted strings, external and internal variables can be used. The TIBCO Hawk agent will execute the command within the back quotes and return the string for substitution.

For example, ’echo /tmp/foo.log’ will be evaluated to /tmp/foo.log

patternfile

String

The pattern file containing the severity values and the Perl5 patterns. The pattern file cannot be empty, it should contain atleast one valid entry. Each line in the pattern file should contain an integer severity level followed by a white space and a valid Perl5 pattern.

A negative severity level (for example, -1) means that all lines that match this pattern are to be ignored. All other severity levels (positive or 0) indicate that lines matching the corresponding patterns are of interest

Returns

 

Name

Type

Description

severity

Integer

The severity value of the matching pattern

pattern

String

The Perl5 pattern string of the matching pattern

nextLine

String

The next available line in the log file

previousLine

String

The previous line in the log file