Kibana shows watcher config error if you dont enter an index

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

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

Hi Kobel,

the version is: Kibana 7.4.0

and if you try to edit it:

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

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

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

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

Hi Kobel,

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

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