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.
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"
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.