Time to upgrade! You only have until October 31, 2019 to move to Dynatrace, our all-in-one software intelligence platform. For details, see the Synthetic Upgrade Center and Dynatrace Synthetic documentation.

Capture response data using an event hook

This sample code is an event hook that looks for a specific request and captures the body of the response for that request. In this sample, we are capturing the response of a specific query, and putting that response in the variable body. Any parsing or decision making can then be done against this variable.

var getUrl = new AddEventHookCommand({
"eventType": "replyReceived",
"name": "directNavigate",
"handler":"if(response.getRequest().getUrl().indexOf('http://root.brainhoney.bfwpub.com/BrainHoney/status.aspx?level=3') != -1){body = response.content;}"