# Need to schedule a query

**URL:** <https://discuss.elastic.co/t/need-to-schedule-a-query/286360>\
**Category:** Kibana\
**Tags:** windows\
**Created:** [October 11, 2021, 11:09am UTC](https://discuss.elastic.co/t/need-to-schedule-a-query/286360 "2021-10-11T11:09:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SRIGURU\_VEL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sriguru_vel/32/88656_2.png) [@SRIGURU\_VEL](https://discuss.elastic.co/u/SRIGURU_VEL)\
**Post date:** [October 11, 2021, 11:09am UTC](https://discuss.elastic.co/t/need-to-schedule-a-query/286360/1 "2021-10-11T11:09:46Z")

</div>

Hi Experts,

I want to schedule a query in kibana . Is any possibility to do that?  
will share you my query.

> PUT index/\_delete\_by\_query  
> {  
> "query":{"range":{"createdon":{"lt":"now-1d","format" : "yyyy-MM-dd HH:mm:ss"}}}  
> }

thanks in advance,  
Sriguruvel.

---

<div class="post-metadata">

**Author:** ![sebastien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien/32/36119_2.png) [@sebastien](https://discuss.elastic.co/u/sebastien)\
**Post date:** [October 11, 2021, 2:34pm UTC](https://discuss.elastic.co/t/need-to-schedule-a-query/286360/2 "2021-10-11T14:34:32Z")

</div>

Hi @SRIGURU_VEL

You might want to create a watch for that and call a dedicated Webhook. As you are doing a destructive operation make sure to secure your endpoint.

Fom Kibana you can access the UI to create an [advanced watch](https://www.elastic.co/guide/en/kibana/current/watcher-ui.html#watcher-create-advanced-watch) from Stack management \> Watcher.

Here are the docs for the webhook watches: [Watcher webhook action | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-webhook.html)

Cheers  
Sébastien

---

<div class="post-metadata">

**Author:** ![SRIGURU\_VEL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sriguru_vel/32/88656_2.png) [@SRIGURU\_VEL](https://discuss.elastic.co/u/SRIGURU_VEL)\
**Post date:** [October 13, 2021, 7:03am UTC](https://discuss.elastic.co/t/need-to-schedule-a-query/286360/3 "2021-10-13T07:03:27Z")

</div>

Hi @sebastien ,

Thanks for reply .I am using Searchguard for authentication . watcher is X-pack plugin.  
Now what to do?.

thanks ,  
Sriguruvel.

---

<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:** [November 10, 2021, 7:04am UTC](https://discuss.elastic.co/t/need-to-schedule-a-query/286360/4 "2021-11-10T07:04:23Z")

</div>

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