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

I have shell script to get the status of the elk watcher
curl -k -s -X GET -H "Authorization: AAAAAA 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.

Hey @basavarajvn0513,

You can get an example curl command via the docs here.

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

Thanks
In get method I have authorization key and my elastic url
curl -k -s -X GET -H "Authorization: ApiKey AAAAAA "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"

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