# How to start the ELK watcher (POST \_watcher/\_start) in shell script through curl command

**URL:** <https://discuss.elastic.co/t/how-to-start-the-elk-watcher-post-watcher-start-in-shell-script-through-curl-command/325379>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [February 13, 2023, 11:44am UTC](https://discuss.elastic.co/t/how-to-start-the-elk-watcher-post-watcher-start-in-shell-script-through-curl-command/325379 "2023-02-13T11:44:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![basavarajvn0513](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@basavarajvn0513](https://discuss.elastic.co/u/basavarajvn0513)\
**Post date:** [February 13, 2023, 11:44am UTC](https://discuss.elastic.co/t/how-to-start-the-elk-watcher-post-watcher-start-in-shell-script-through-curl-command/325379/1 "2023-02-13T11:44:21Z")

</div>

I have shell script to get the status of the elk watcher  
curl -k -s -X GET -H "Authorization: AAAAAA [https://elastic](https://elastic)

If the status is not started I am sending the alerts .

Now I also I want to start the elk watcher. (POST \_watcher/\_start) which works through dev tool in UI.  
How to use this command (POST \_watcher/\_start) from curl throught the shell script to start watcher when the shell script is run.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Buttner](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@Jonathan\_Buttner](https://discuss.elastic.co/u/Jonathan_Buttner)\
**Post date:** [February 13, 2023, 6:30pm UTC](https://discuss.elastic.co/t/how-to-start-the-elk-watcher-post-watcher-start-in-shell-script-through-curl-command/325379/2 "2023-02-13T18:30:14Z")

</div>

Hey @basavarajvn0513,

You can get an example curl command via the docs [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html).

```auto
curl -X POST "<your elasticsearch>/_watcher/_start?pretty"

```

---

<div class="post-metadata">

**Author:** ![basavarajvn0513](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@basavarajvn0513](https://discuss.elastic.co/u/basavarajvn0513)\
**Post date:** [February 14, 2023, 7:36am UTC](https://discuss.elastic.co/t/how-to-start-the-elk-watcher-post-watcher-start-in-shell-script-through-curl-command/325379/3 "2023-02-14T07:36:31Z")

</div>

Thanks  
In get method I have authorization key and my elastic url  
curl -k -s -X GET -H "Authorization: ApiKey AAAAAA "[https://myelastic.com](https://myelastic.com)

In post method where to use authorization key and my elastic url.

Is my below command correct ?  
curl -X POST "Authorization: ApiKey AAAAAA "[https://myelastic.com/\_watcher/\_start?pretty](https://myelastic.com/_watcher/_start?pretty)"

---

<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:** [March 14, 2023, 7:36am UTC](https://discuss.elastic.co/t/how-to-start-the-elk-watcher-post-watcher-start-in-shell-script-through-curl-command/325379/4 "2023-03-14T07:36:37Z")

</div>

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