To monitor a log file for a specific string (e.g., "ERROR => Exiting" or "temporary name resolution failure"), follow these steps:
- Open the logmon probe configuration.
- Create a new Profile and define the log file path in the File field (e.g., /var/log/syslog or C:\logs\app.log).
- In the General tab, ensure the Generate Alarm checkbox is enabled.
- Navigate to the Watcher Rules tab and click New to create a rule.
- In the Match Expression field, enter the string pattern using asterisks for wildcards (e.g., *ERROR => Exiting* or *temporary name resolution failure*). You may also use Regular Expressions by enclosing them in forward slashes, e.g. /.*ERROR\s=>\sExiting.*/
- (Optional) To create alarms based on the number of occurrences:
- Navigate to the QOS tab under Watcher Rules.
- Enable Count Matches.
- In the Alarm tab, set the appropriate operator and threshold (e.g., < 10).
- Define variables in the Variables tab if you need to extract specific data from the log line using regex.
- Click OK and restart the probe to apply changes.