Hi,
I would like to create an error log when a document is not suitable for my mapping.
For example if I send a document containing an unknown field in my mapping (dynamic:false), I would like to be able to create an error log in another index.
Okay, thx for the doc.
But the on_failure parameter work with a processor, which one can i use ?
I just want to test the incoming documents, et create an error when a field is unknow.
Unless there is something not well explained in the documentation, I don't think it is possible.
The on_failure parameter applies to errors on processors in the ingest pipeline, it allows you to deal with errors during the ingest pipeline processing, the mapping error will happen after that phase, when Elasticsearch tries to index it.
Maybe you can use the script processor to write a painless script that will test each field and see if they are in a list of allowed fields, but I do not have experience with painless script to know how you can do that.
But I don't think this is something easy to do, and also it can impact the performance.
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.