# Testing error handlers in elasticsearch 6.5 (kafka to ES)

**URL:** <https://discuss.elastic.co/t/testing-error-handlers-in-elasticsearch-6-5-kafka-to-es/160340>\
**Category:** Elasticsearch\
**Created:** [December 11, 2018, 9:59am UTC](https://discuss.elastic.co/t/testing-error-handlers-in-elasticsearch-6-5-kafka-to-es/160340 "2018-12-11T09:59:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon17386273](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@anon17386273](https://discuss.elastic.co/u/anon17386273)\
**Post date:** [December 11, 2018, 9:59am UTC](https://discuss.elastic.co/t/testing-error-handlers-in-elasticsearch-6-5-kafka-to-es/160340/1 "2018-12-11T09:59:52Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/hadoop/current/errorhandlers.html](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/errorhandlers.html)

Does anyone has working example of error handling for elasticsearch? I am exploring the elasticsearch 6.5 where error handlers are provided to pipe erroreous records to files

Example:  
error.handler.writeFile = org.myproject.myhandlers.OutputToFileHandler es.write.rest.error.handler.writeFile.filename = /path/to/some/output/file

Currently, i am not sure how can i produce sample erroreous records for testing of this feature.  
So far, I have placed the error handlers codes into my scala program and managed to compile and run successfully. Records are able to read from kafka and write into ES

Any help would be appreciated on this. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 8, 2019, 9:59am UTC](https://discuss.elastic.co/t/testing-error-handlers-in-elasticsearch-6-5-kafka-to-es/160340/2 "2019-01-08T09:59:55Z")

</div>

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