cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Log File Monitoring Plugin - Number of Messages: The number of lines that matched the Search Term

masum_rahman
Participant

Log File Monitoring Plugin
- Number of Messages: The number of lines that matched the Search Term.

Hi,

Does this number indicate match in each scan or added with
matches found in previous scans? For example, I schedule the file scan every 10
mins. In the first scan it finds 2 matches. Before the next scan, some lines
are added and among the new lines there are 3 more matches. When the next scan
occurs, will Number of Messages be 3 or 5 (2+3)?

If I want to scan multiple strings for the same file, how
can I achieve that? For example, if the log file contains Error or
MemoryOutOfBound
, I want to send a support email. How can I do that?

Looking forward to hearing from you soon.

Thanks,

Masum

6 REPLIES 6

andreas_grabner
Dynatrace Guru
Dynatrace Guru

Hi

Based on the description on the plugin page - Log File Monitor - I am pretty sure it only counts the new entries it found since the last scan. Here is what it says in the description:

It stores the last result and position in the monitored file in a Oracle, PostgreSQL, or SQL Server database so that it knows where it ended the last time it ran so it's not reading the same lines over and over. If the log file rolls over the monitor is smart enough to see that and starts from the beginning of the file again. The table in the database can be created by running the attached scripts or you can use the screenshot from the Design view in the table to manually enter the values. The script will create the table on a database called dynaTracePluginDB. Change this name if you desire.

I hope this answer your question

graeme_william1
Inactive

Masum,

To add to Andi's answer, the search term is a regular expression, so you can search for (e.g.) "Error|MemoryOutOfBound" (without the quotes).

-- Graeme

masum_rahman
Participant

Thank you guys.

@Graeme, if I put multiple matching strings like this, would the support email specifically tells which one of the strings is matched?

Thanks,

Masum

masum_rahman
Participant

Hi,

One more thing, how can I configure where the alerts should go once the matching is found the desired number of times?

Thanks,

Masum

graeme_william1
Inactive

Masum,

It doesn't look as though you have access to which string out of a set of alternatives is matched.

You can generate an alert using the "New Message" measure returned by the monitor. Set the threshold to 1 (meaning a line was matched) and create an incident using the measure. In the incident, you can define what you want done, such as sending an email.

-- Graeme

katlegok
Guide

Hi @Graeme W.

I am having some issues with the regex for the file search term : Here is the file regex I have

logapp_logfunction_creditors_server_(.*)

at the end there is a date stamp for each for each new file that is created and I am not sure why this is not writing to the DB as this is suppose to be reading the new file or most recent one. Connection to the DB is fine as we tested with the full name of the plugin and it writes.

Is the regex incorrect or do we still need to do some more work on it?

Thanks

Katlego