# How to import blob type from mysql to es using logstash

**URL:** <https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136>\
**Category:** Logstash\
**Created:** [November 2, 2017, 8:10am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136 "2017-11-02T08:10:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Canappeco](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@Canappeco](https://discuss.elastic.co/u/Canappeco)\
**Post date:** [November 2, 2017, 8:10am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136/1 "2017-11-02T08:10:56Z")

</div>

Hi all.

I am importing data from mysql to es using logstash. I have a blob type in a table in mysql. Because I used to convert the array of double to binary and save as blob. Now I want to import this type of data to es, but it is automatically converted into text type.

In short, I want to change the blob type into

```auto
[0.001, 0.002, ...]

```

and save as Float in es.

Can anyone give some advice? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 2, 2017, 8:28am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136/2 "2017-11-02T08:28:52Z")

</div>

What does the field look like now? Use a `stdout { codec => rubydebug }` to dump the raw field contents.

---

<div class="post-metadata">

**Author:** ![Canappeco](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@Canappeco](https://discuss.elastic.co/u/Canappeco)\
**Post date:** [November 2, 2017, 8:38am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136/3 "2017-11-02T08:38:16Z")

</div>

Thanks for your response!

I get something as follow:

```auto
"feature" => #<Sequel::SQL::Blob:0x322dc bytes=512 start="\x92C\x1C\xBE\x80f\xFF<\x8C\xB5" end="2=\x84\xA5\xA5=\xE6g\xF1\xBC">

```

The "feature" is actually the type of blob.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 2, 2017, 8:42am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136/4 "2017-11-02T08:42:45Z")

</div>

Logstash cannot decode that, you need something else to do that for you I think.

---

<div class="post-metadata">

**Author:** ![Canappeco](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@Canappeco](https://discuss.elastic.co/u/Canappeco)\
**Post date:** [November 2, 2017, 8:46am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136/5 "2017-11-02T08:46:14Z")

</div>

ok... It seems that I have to load data from mysql and do some processing and save it into es, right?

Thanks for your response!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 2, 2017, 10:05am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136/6 "2017-11-02T10:05:11Z")

</div>

You should be able to process and convert that object in a ruby filter.

---

<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:** [November 30, 2017, 10:05am UTC](https://discuss.elastic.co/t/how-to-import-blob-type-from-mysql-to-es-using-logstash/106136/7 "2017-11-30T10:05:17Z")

</div>

Closed on November 30, 2017, 10:05am UTC

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