cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancing AS Java Logfile Monitoring using MAI

Former Member
0 Kudos

Hi,

We want to monitor Logfiles from SAP Java Stacks in Solution Manager.
We already set this up with a Custom Metric Group and it works fine on the first impression.

This is realized with Datacollector ReadLogFile from DiagnosticAgent(Push).
E.g. we can get an Alert for all Logs with "Severity" Error or can handle special "FILTER_TEXT" Regexps in the metric, or Application or location (see my attached example)

After request to SAP to add the missing severity levels to the standard delivery we now also have 'fatal' error classification.

But the normal typical use case - in terms of 'FILTER_TEXT' is, that we don't know the errors text before they occur.
And for example, we do know that certain "errors" are "normal" and should be safely ignored in the meantime not producing alerts.

So, what we want to have is
* get all logs with specific severity, e.g. error
* BUT NOT with "some error 1 we already know" (based on location L1)
* AND NOT with "some error 2 we already know" (based on error text T2)
...

We know that Regex has a slightly difficult syntax for -not-, but using (.*(?!error1).*)|(.*(?!error2).*) or (.*(?!\Qerror1\E).*)|(.*(?!\Qerror2\E).*)
did not succeed.

So our questions:
a) Can anyone point us to a solution, where we can use this pretty normal log file /alert checking behavior (ALL ERRORS, BUT NOT TEXT E1,E2,... OR NOT LOCATION L1,L2) in standard customizing OR
b) point us to a solution, where we can implement this by ourselves. We have seen the data collector used is com.sap.smd.mai.model.collector.SAPControlWSCollector/ReadLogFile
but we are unsure, if we are able to deploy our own custom class for this (maybe just extending the standard class) and how to do this.

Thanks a lot for your support and any Hints!
 

BR, Mat

Accepted Solutions (0)

Answers (2)

Answers (2)

TomCenens
Active Contributor
0 Kudos

Hi Matthias

I've got a similar use case where I check job logs from an external job scheduler.

What I did is write a script on OS level that filters out the log and like you say, discards some lines where we don't find that log line important. The scripts writes another log file and that log file is utilized for interpretation by SAP Solution Manager.

Best regards

Tom

divyanshu_srivastava3
Active Contributor
0 Kudos

Hi Mat,

If you would like to do it from backend....

You can write your own code in java code, read and scan the log files based on conditions you want to impose, use SAPControl web service interface, compile the code using current JVM of your server and schedule a cron job for the same.

To be HONEST, I have never used a custom class, like you said, by standing a standard class( in terms of hard code)

Regards,