# Logstash port data from Mysql, cannot handle tinyint type field defined from Mysql

**URL:** <https://discuss.elastic.co/t/logstash-port-data-from-mysql-cannot-handle-tinyint-type-field-defined-from-mysql/77227>\
**Category:** Logstash\
**Created:** [March 2, 2017, 10:19pm UTC](https://discuss.elastic.co/t/logstash-port-data-from-mysql-cannot-handle-tinyint-type-field-defined-from-mysql/77227 "2017-03-02T22:19:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [March 2, 2017, 10:19pm UTC](https://discuss.elastic.co/t/logstash-port-data-from-mysql-cannot-handle-tinyint-type-field-defined-from-mysql/77227/1 "2017-03-02T22:19:28Z")

</div>

I defined the field as integer in elasticsearch type template, here is the screenshot of the definition in kibana

 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/6/e610b7050d02c62094475d6fc3db469df820cf67.png)

I use logstash to port data from mysql to elasticsearch, when I turn on the pipeline, this response is repeated for each message I ingest.

2:15:47.934 [[main]\>worker0] WARN logstash.outputs.elasticsearch - Failed action. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"leads\_2017\_02", :\_type=\>"log", :\_routing=\>nil}, 2017-03-02T22:15:43.916Z %{host} %{message}], :response=\>{"index"=\>{"\_index"=\>"leads\_2017\_02", "\_type"=\>"log", "\_id"=\>"AVqRF9pmPvi4HyPItega", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse [record\_impression]", "caused\_by"=\>{"type"=\>"json\_parse\_exception", "reason"=\>"Current token (VALUE\_FALSE) not numeric, can not use numeric value accessors\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@7464568c; line: 1, column: 509]"}}}}

---

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [March 2, 2017, 11:03pm UTC](https://discuss.elastic.co/t/logstash-port-data-from-mysql-cannot-handle-tinyint-type-field-defined-from-mysql/77227/2 "2017-03-02T23:03:11Z")

</div>

Problem solved. Looks like logstash does not recognize tinyint from mysql, so I converted the field to char type in mysql query, and then in logstash filter, use mutation to convert it to integer. It works.

---

<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:** [March 30, 2017, 11:03pm UTC](https://discuss.elastic.co/t/logstash-port-data-from-mysql-cannot-handle-tinyint-type-field-defined-from-mysql/77227/3 "2017-03-30T23:03:17Z")

</div>

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