# Output data to elasticsearch with null\_pointer\_exception

**URL:** <https://discuss.elastic.co/t/output-data-to-elasticsearch-with-null-pointer-exception/191756>\
**Category:** Logstash\
**Created:** [July 23, 2019, 7:24am UTC](https://discuss.elastic.co/t/output-data-to-elasticsearch-with-null-pointer-exception/191756 "2019-07-23T07:24:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxyyxzzxy001](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zxyyxzzxy001](https://discuss.elastic.co/u/zxyyxzzxy001)\
**Post date:** [July 23, 2019, 7:24am UTC](https://discuss.elastic.co/t/output-data-to-elasticsearch-with-null-pointer-exception/191756/1 "2019-07-23T07:24:03Z")

</div>

I want to use logstash transfer data from mysql to elasticsearch. I use dynamic template to define IK tokenizer which is used for chinese, but some data transfer successfully, others failed with : response code: 500 ({"type"=\>"null\_pointer\_exception", "reason"=\>nil}).

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/1/a1ad3e160a4720a6bacc7e4869aec54de87d8823.png)  
Here is my logstash.conf:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/0/80475b3820d7ec7d9f9ab21b1a6e53d7fed23c63.png)  
and my logstash.json which define the dynamic template:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/2/6257aeb3d954ff694498359c43d73722b304eaa5.png)  
I don't know why some data transfer failed with the null\_pointer\_exception.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 23, 2019, 1:16pm UTC](https://discuss.elastic.co/t/output-data-to-elasticsearch-with-null-pointer-exception/191756/2 "2019-07-23T13:16:58Z")

</div>

If logstash gets a 500 error from elasticsearch I would expect there to be a more informative error message in the elasticsearch logs.

---

<div class="post-metadata">

**Author:** ![zxyyxzzxy001](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zxyyxzzxy001](https://discuss.elastic.co/u/zxyyxzzxy001)\
**Post date:** [July 24, 2019, 2:59am UTC](https://discuss.elastic.co/t/output-data-to-elasticsearch-with-null-pointer-exception/191756/3 "2019-07-24T02:59:31Z")

</div>

Thanks a lot,that's enlightening.

---

<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:** [August 21, 2019, 2:59am UTC](https://discuss.elastic.co/t/output-data-to-elasticsearch-with-null-pointer-exception/191756/4 "2019-08-21T02:59:42Z")

</div>

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