# Watcher issue in x-pack

**URL:** https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508
**Category:** Elasticsearch
**Created:** [April 27, 2016, 6:55am UTC](https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508 "2016-04-27T06:55:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![udaykirankona](https://avatars.discourse-cdn.com/v4/letter/u/ac91a4/32.png) [@udaykirankona](https://discuss.elastic.co/u/udaykirankona)
#### Post date: [April 27, 2016, 6:55am UTC](https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508/1 "2016-04-27T06:55:54Z")

</div>

Hi guys,

I installed ES. logstash. kibana 5.0 with x-pack.

when I am trying to run following command

curl --user watching:watching -XGET '[http://localhost:9200/.watcher-history\*/\_search?pretty](http://localhost:9200/.watcher-history*/_search?pretty)'

I am getting following error

"payload" : {  
"error" : {  
"root\_cause" : [ {  
"type" : "security\_exception",  
"reason" : "missing authentication token for REST request [/\_cluster/health]",  
"header" : {  
"WWW-Authenticate" : "Basic realm="shield""  
}  
} ],  
"type" : "security\_exception",  
"reason" : "missing authentication token for REST request [/\_cluster/health]",  
"header" : {  
"WWW-Authenticate" : "Basic realm="shield""  
}  
},  
"status" : 401  
},  
Can you please help me to resolve this.

Thanks in advance

Uday.K

---

<div class="post-metadata">

### Author: ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)
#### Post date: [April 27, 2016, 10:11am UTC](https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508/2 "2016-04-27T10:11:50Z")

</div>

Hi Uday,

A few questions, is the error you are getting directly from the curl request you posted? It appears to be a different request `/_cluster/health`. Do you have have any realm configuration or custom settings?

-Jay

---

<div class="post-metadata">

### Author: ![udaykirankona](https://avatars.discourse-cdn.com/v4/letter/u/ac91a4/32.png) [@udaykirankona](https://discuss.elastic.co/u/udaykirankona)
#### Post date: [April 27, 2016, 10:35am UTC](https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508/3 "2016-04-27T10:35:55Z")

</div>

Hi Jay,

these are steps we followed

PUT /\_watcher/watch/cluster\_health\_watch  
{  
"trigger" : {  
"schedule" : { "interval" : "10s" }  
},  
"input" : {  
"http" : {  
"request" : {  
"host" : "localhost/IP",  
"port" : 9200,  
"path" : "/\_cluster/health"  
}  
}  
}  
}

1. first I scheduled watcher and then tried to get results using curl  
which is - curl --user watching:watching -XGET '[http://IP:9200/.watcher-history\*/\_search?pretty](http://IP:9200/.watcher-history*/_search?pretty)'
2. We dont have any custom realm, I am using esusers (default) realm.

Thanks,  
Uday.K

---

<div class="post-metadata">

### Author: ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)
#### Post date: [April 27, 2016, 11:20am UTC](https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508/4 "2016-04-27T11:20:42Z")

</div>

Ah I see. You will need to provide credentials for your watch to execute, which our documentation does not clearly state. I'll open a issue to get this corrected. For details on how to do this, see:

[https://www.elastic.co/guide/en/x-pack/current/input.html#\_calling\_external\_webservices](https://www.elastic.co/guide/en/x-pack/current/input.html#_calling_external_webservices)

---

<div class="post-metadata">

### Author: ![udaykirankona](https://avatars.discourse-cdn.com/v4/letter/u/ac91a4/32.png) [@udaykirankona](https://discuss.elastic.co/u/udaykirankona)
#### Post date: [April 27, 2016, 11:33am UTC](https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508/5 "2016-04-27T11:33:10Z")

</div>

Thanks Jay, it worked.

---

<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: [July 6, 2017, 1:41pm UTC](https://discuss.elastic.co/t/watcher-issue-in-x-pack/48508/6 "2017-07-06T13:41:08Z")

</div>


