Alert on an existing visualization of type "metric"

Hello, I've created a dashboard with a visualization of type "metric". The visualization displays the number of the log entries of type "ERROR" in the selected time span.

Is it possible to define an alert on this visualization, i.e. on the measure displayed there?

The rationale is that I'd like to reuse the definition of what "bad" or "suspicious" is. The checking time interval and threshold would be difined in the alert, but the definition of what records to consider (this might include other criteria, e.g. a word in the log message) would be shared by the visualization and the alert.

Thank you for any hints.

Hi @fml2,

to my knowledge duplicating the query can't be avoided yet. Re-using saved queries or searches has been requested before and is tracked in Using Saved Searches as input for creating Threshold Alerts · Issue #18042 · elastic/kibana · GitHub. Please feel free to add your voice to that request so the feature can be shaped to match your use-case.