# Create alert for long running query from the logs in Kibana alert

**URL:** https://discuss.elastic.co/t/create-alert-for-long-running-query-from-the-logs-in-kibana-alert/311736
**Category:** Elasticsearch
**Created:** [August 9, 2022, 1:30pm UTC](https://discuss.elastic.co/t/create-alert-for-long-running-query-from-the-logs-in-kibana-alert/311736 "2022-08-09T13:30:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![skathir29](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skathir29/32/108592_2.png) [@skathir29](https://discuss.elastic.co/u/skathir29)
#### Post date: [August 9, 2022, 1:30pm UTC](https://discuss.elastic.co/t/create-alert-for-long-running-query-from-the-logs-in-kibana-alert/311736/1 "2022-08-09T13:30:17Z")

</div>

Need to get alerted if the time difference between these below two log event is more than 10 mins, Kindly provide some hint to do this Alerts / watcher in Kibana.

| @timestamp | DatabaseName | UserName | ServerName | Duration | Completed | State | Id | Type | StartTime | EndTime | Query |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Aug 9, 2022 @ 13:46:37.316 | db\_1 | ab112233 | test\_1 | 26,538 | TRUE | OK | 2050 | endRequest | Aug 9, 2022 @ 09:46:02.494 | Aug 9, 2022 @ 09:46:29.032 | SELECT prjt\_id FROM prj\_cyle\_time where prjt\_id = '10' context ('i18n' = 'us\_est' ) |
| Aug 9, 2022 @ 13:46:05.310 | db\_1 | ab112233 | test\_1 | 0 | - | - | 2050 | startRequest | Aug 9, 2022 @ 09:46:02.494 | - | SELECT prjt\_id FROM prj\_cyle\_time where prjt\_id = '10' context ('i18n' = 'us\_est' ) |

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 2, 2022, 1:30pm UTC](https://discuss.elastic.co/t/create-alert-for-long-running-query-from-the-logs-in-kibana-alert/311736/2 "2022-09-02T13:30:27Z")

</div>

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