I have a watcher. I want every time when the watcher got triggered, some (maybe 0, 1 or more than 1) documents can be inserted into an index based on the aggregation result.
The action looks like below in my watcher test, but it does not work.
I want to insert 2 docs: {foo: bar1}, {foo: bar2}
There is no example for https://www.elastic.co/guide/en/watcher/current/actions.html#anatomy-actions-index-multi-doc-support
Thanks so much !
"actions": {
"put_daily_agg": {
"transform" : {
"script" : "return _doc : [foo : bar1, foo: bar2]"
},
"index": {
"index" : "my-index",
"doc_type" : "my-type"
}
}