# How can i convert text column in sql to array type field in elasticsearch using Logstash?

**URL:** https://discuss.elastic.co/t/how-can-i-convert-text-column-in-sql-to-array-type-field-in-elasticsearch-using-logstash/74505
**Category:** Logstash
**Created:** [February 9, 2017, 1:20pm UTC](https://discuss.elastic.co/t/how-can-i-convert-text-column-in-sql-to-array-type-field-in-elasticsearch-using-logstash/74505 "2017-02-09T13:20:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Adinarayana\_Murthy](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Adinarayana\_Murthy](https://discuss.elastic.co/u/Adinarayana_Murthy)
#### Post date: [February 9, 2017, 1:20pm UTC](https://discuss.elastic.co/t/how-can-i-convert-text-column-in-sql-to-array-type-field-in-elasticsearch-using-logstash/74505/1 "2017-02-09T13:20:22Z")

</div>

Hi

I want to convert the SQL column that contains text data to array of strings before storing into the elastics server.  
eg:

Data in SQL with column name as "tags"

tags : "Monday Today lastday"

i want to store this as array of strings in elastic server as same field name "tag" or new name

"tags" : ["Monday", "Today","lastday"]

Could some suggest the config i need to give in logstash-jdbc.conf to convert input text sentence to array of strings that need to be stored as new field in elastic server using logstash ?

---

<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: [February 9, 2017, 1:26pm UTC](https://discuss.elastic.co/t/how-can-i-convert-text-column-in-sql-to-array-type-field-in-elasticsearch-using-logstash/74505/2 "2017-02-09T13:26:30Z")

</div>

Look into the mutate filter's split option.

---

<div class="post-metadata">

### Author: ![Adinarayana\_Murthy](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Adinarayana\_Murthy](https://discuss.elastic.co/u/Adinarayana_Murthy)
#### Post date: [February 9, 2017, 8:26pm UTC](https://discuss.elastic.co/t/how-can-i-convert-text-column-in-sql-to-array-type-field-in-elasticsearch-using-logstash/74505/3 "2017-02-09T20:26:20Z")

</div>

Perfect !! it is very easy 🙂 Thanks a lot Magnus Bäck

---

<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 9, 2017, 8:26pm UTC](https://discuss.elastic.co/t/how-can-i-convert-text-column-in-sql-to-array-type-field-in-elasticsearch-using-logstash/74505/4 "2017-03-09T20:26:54Z")

</div>

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