Use Synthetic Monitor Logs in Workflow Template

Is there a way to add console.log output from a synthetic monitor into an alert workflow template?

If it is not yet possible to do so, is there a way to store the logs in an enricher variable and include that enricher variable as text in the workflow template? I tried this approach, but it is unclear how I can extract the log text from the enricher variable’s value. I tried following the advice within https://discuss.newrelic.com/t/relic-solution-how-to-customize-workflow-payload/189565 but as soon as I try to edit a webhook payload with {{ json enricherVariable.result }} I end up with a form error and cannot save (it doesn’t like dereferencing enricherVariable with .result).

Thanks

Hi, @recunius1: I think you will have to capture the browser log from your Synthetics script and add the relevant entries as custom attributes to the SyntheticCheck event. Then those attributes will be available for you to add to your workflow template.

Hi, @philweber

Thanks for the tips.

I am trying to setting custom attributes just as you describe. I am able to then look up those attributes using the enricher NRQL syntax just as your link describes. My remaining issue is how to get the text out of the attribute and into the workflow template. Right now I am to read {{ enricherVariable }} in my template, but it is full of extra metadata and JSON structure that I don’t want. I just want to extract {{ enricherVariable.results.latest }} but that doesn’t appear to work. I also tried {{ enricherVariable.result }} like the link I provided mentions. But whenever I try to dereference enricherVariable the webhook template editor does not let me save it complaining that my syntax has an error.

Should what I’m trying work?

Thanks, Bob

Sorry, I don’t know. Hopefully someone else will have additional suggestions.

I figured it out. I did not have to dereference the enricherVariable at all. I believe my issue was not properly saving the enricher chart type as JSON, although I thought I had.

Thanks for the assist.

1 Like