I am trying to aggregate ctx source fields (triggered source event fields) and force watcher to write them to watcher-history index. For eg i wanna pass the ctx.payload.hits.hits.0._source.computer_name of a winlogbeat as new field to the watcher-history index. Is there a way?
I tried tranform script , webhook and update_query but none of the seem to work as expected. I really could use an example .
the watcher history index mapping should not be fiddled with. However, all the results of a search are already written into a watch record (the name for a single entry in the history), albeit not searchable.
If you need to have this searchable you should probably reindex the data in your own index. When doing that you might want to take a look at the result.input field which contains your search.
I need to write ctx.payload.hits.hits.0._source.field or result.input.payload.hits.hits fields (if accessible) to watcher-history index or another index if it is possible and write watches that correlates the correlated events.
I understand why i shouldn't write to watcher-history index but i need to have the fields accessed and searched. Is it possible? Can a watcher action write payload fields to an index to map them?
I would appreciate an example .
Thanks again for your help
And although the response is successive in the correlated index i see nothing. Note that without transform hit is indexed in the correlated.
Any clues?
Nope i want all the field from the hit to populated to the new index through a transform loop. And not add them manually. Or maybe pass someway the hits json as a whole?
I am not sure which way is better. An example could help.
yes that would work. my example above simply copies all fields. Also you could of course create black/whitelist to only include a certain set of fields, without having to specify them manually.
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.