Watcher alert for an scripted field

Is it possible to set up a Watcher alert for an scripted field overcoming a threshold value? For example, when latency (scripted field for endTime - startTime) overcomes 500 ms, send me an alert

The condition in watcher allows you to use scripting to define the threshold, like 500ms. If your script is stored, there is also some info on that page for how to refer to it by ID. But you would likely just pull in the documents that have the endTime and startTime and then use the condition and your stored script by ID (or write a script).

1 Like

Oh, I think maybe you were referring to kibana scripted fields. Is this correct? If so, kibana just stores those scripts itself, so there is no easy way to refer to them. As per the docs, Scripted field values are computed at query time so they aren’t indexed, so this means elasticsearch knows nothing about them, sadly :frowning:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.