# Kibana shows watcher config error if you dont enter an index

**URL:** <https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038>\
**Category:** Kibana\
**Created:** [October 24, 2019, 9:55am UTC](https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038 "2019-10-24T09:55:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Messias\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/messias_2/32/74381_2.png) [@Messias\_2](https://discuss.elastic.co/u/Messias_2)\
**Post date:** [October 24, 2019, 9:55am UTC](https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038/1 "2019-10-24T09:55:58Z")

</div>

Hi,

I get an config error in kibana when I edit a watcher config where no index is entered , even if you use \_doc fields in transform / payload.

kibana error:  
" Please address the errors in your form.

- Index name is required."

config part:

.......  
"actions": {  
"alert": {  
"index": {  
"execution\_time\_field": "lastrun"  
\<---- no index is set here  
}  
}  
}

the watcher runs as expected. But kibana shows an error where no error is and I cant edit it with kibana. So this error is only correct if you do not use the \_doc in payload. And the check always expect the index field. If I enter an index in this field the execution failed with an error. It is a confict between the index set in action (as kibana expect) and the \_doc in the payload.

So is it maybe possible to change the error to an warning? So you can edit this kind of watcher.

best regards  
Torsten

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 24, 2019, 7:45pm UTC](https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038/2 "2019-10-24T19:45:06Z")

</div>

Hey @Messias_2, what version of Kibana are you using? Also, can you provide a screenshot of the error that you're seeing?

---

<div class="post-metadata">

**Author:** ![Messias\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/messias_2/32/74381_2.png) [@Messias\_2](https://discuss.elastic.co/u/Messias_2)\
**Post date:** [October 25, 2019, 5:52am UTC](https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038/3 "2019-10-25T05:52:16Z")

</div>

Hi Kobel,

the version is: Kibana 7.4.0

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b3f90b861dbff8bec838b231d2ebf6e314f3b165.png)

and if you try to edit it:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/b/cb01cf3d25e1696e915d59fb86848ce82e42d467.png)

you only need to click edit and save. Even if you try to simulate:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e91653388a2afa0c518b914d28d96988675d2836.png)

but if you call this watcher manually per api [https://elasticsearchip/\_watcher/watch/watcher\_id/\_execute](https://elasticsearchip/_watcher/watch/watcher_id/_execute) it runs without any issues (as expected). The elastic action use the index from \_doc payload.

> **[Index action | Elasticsearch Guide \[7.4\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/actions-index.html)**

last sentence in the document:

> An `_index` , or `_id` value can be added per document to dynamically set the ID of the indexed document.

This is what I use and kibana show an error if no index is set in action. But if you use \_index in \_doc you do not allowed to set a index in the action otherwise the execution will fail even per api.

here a part of the transform script so you can see the index is set as payload in \_doc.\_index:

> "transform": {  
> "script": {  
> "source": "HashMap result = new HashMap();result.\_doc= new HashMap();  
> ...........  
> ;result.\_doc.\_index = ctx.metadata.alert\_index + ctx.trigger.scheduled\_time.toString('yyyy.MM');  
> ............ return result;",  
> "lang": "painless"  
> }  
> }

best regards

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 25, 2019, 3:11pm UTC](https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038/4 "2019-10-25T15:11:15Z")

</div>

Hey @Messias_2, thanks for the detailed recreation steps. Would you mind logging a bug here: [https://github.com/elastic/kibana/issues/new?template=Bug\_report.md](https://github.com/elastic/kibana/issues/new?template=Bug_report.md)

---

<div class="post-metadata">

**Author:** ![Messias\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/messias_2/32/74381_2.png) [@Messias\_2](https://discuss.elastic.co/u/Messias_2)\
**Post date:** [October 28, 2019, 6:41am UTC](https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038/5 "2019-10-28T06:41:13Z")

</div>

Hi Kobel,

thanks for your help. I open a new issue an github.

> <https://github.com/elastic/kibana/issues/49453>

---

<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 25, 2019, 6:41am UTC](https://discuss.elastic.co/t/kibana-shows-watcher-config-error-if-you-dont-enter-an-index/205038/6 "2019-11-25T06:41:13Z")

</div>

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