I have a watcher that looks for transactions with a specific status code in proxy traffic, and will alert if the percentage is above a threshold (eg if the number of 401 errors is above 5% of total, alert).
I use chained input to get the values for total traffic, and for the number of errors, and I use the following condition to work out whether to fire:
"source": "return (ctx.payload.errors.hits.total * 100 / ctx.payload.traffic.hits.total) >=5",
So this fires if the number of errors seen exceeds 5% of the total traffic.
What I want to do is include the actual error percentage in the email that gets triggered - so if the number of errors is say 8%, I include that figure in the email subject or body.
Can anyone tell me if I can include that value in the email somehow?