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

Alert on single line data written into log analytics

Good morning community,

I'm currently ingesting a volume of data inside an analytics schema.
I'm interest in specific dynamic when some of the results are in failed status:

MessageGuid CorrelationId ApplicationMessageId ApplicationMessageType Sender IntegrationFlowName Status Duration_ms Exception
123 abc1 4568 important_application A Route_Idoc FAILED 2433 org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://**************.com/api/data/v7.*/$batch with statusCode: 400
778 abc2 4569 important_application A Route_Idoc FAILED 5120 org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://**************.com/api/data/v7.*/$batch with statusCode: 401
980 abc3 4562 important_application B Route_Idoc FAILED 11563 org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://**************.com/api/data/v7.*/$batch with statusCode: 402
321 abc4 4561 important_application B Route_Idoc FAILED 5180 org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://**************.com/api/data/v7.*/$batch with statusCode: 403
 

My question is the following:

Considering that I'm on Dynatrace Saas, will it be possible to alert from Dynatrace on single results when they contain status failed and send a problem with a custom payload, with values taken from the log line itself?
For an example : when I do have one row with status failed, generate an alert with the following message:

The message <take the value from the analytics MessageGuID> has status <take the value from the analytics  Status> with Exception < value from the analytics Exception>

Thank for any feedback and experience shared,

regards

1 REPLY 1

LukeHearth
Dynatrace Helper
Dynatrace Helper

Hi @y_buccellato ,

I believe yes you can do this with the workflows capabilities inside of Dynatrace. You could have a timer that executes the workflow every x minutes depending on the frequency of how many times the log is written two.

The next step would be creating the DQL query you are looking for and passing the output of it to the next step.

The final step would be a Javascript "node" that would execute the Problems API internally from the workflow to create a custom problem , here you can do some data transformation to select the data you want out of the DQL query results and add it to the body of the problem.

All being well it should look somthing like this:

luke_hearth_0-1704299179628.png

 

 

In addition if you dont get the data out of the DQL "Node" you can allways also query the DQL API from Javascript aswell so you would just have 1 JS "node" that queries , processes and posts a Dynatrace problem.

Featured Posts