# Logstash configuration file

**URL:** https://discuss.elastic.co/t/logstash-configuration-file/112432
**Category:** Logstash
**Created:** [December 19, 2017, 12:30pm UTC](https://discuss.elastic.co/t/logstash-configuration-file/112432 "2017-12-19T12:30:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Amir\_P](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@Amir\_P](https://discuss.elastic.co/u/Amir_P)
#### Post date: [December 19, 2017, 12:30pm UTC](https://discuss.elastic.co/t/logstash-configuration-file/112432/1 "2017-12-19T12:30:58Z")

</div>

Hello,  
I wrote a logstash configuration file to sql server (a simple one, taking the table as is and index it), but i want to store each row (documents) from the table as an array in elastic. Do I need to write it at the filter section or at the output section or even at the sql statement?  
Can someone show me an example how to do it?

I want the JSON will look like this:  
“Table\_name”:”**_”,  
“Values”: ["field1value", "field2value", “field3value”....],  
“X\_coordinates”:”_**”,  
“Y\_coordinates”:”**_”,  
“MySerialNumber”:”_**\_\_”  
“Shape”:”\_\_\_\_\_\_\_\_\_”

\*each table on my db has 4 generic columns: X,Y,serialnumber and Shape  
\*\*the x,y are the center of the polygon(for kibana)  
\*\*\*the shape is a an array of coordinates.  
\*\*\*\*I only need to insert each table once (no new rows will be added)

Thanks ahead!

---

<div class="post-metadata">

### Author: ![arisbanach](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@arisbanach](https://discuss.elastic.co/u/arisbanach)
#### Post date: [December 20, 2017, 6:49pm UTC](https://discuss.elastic.co/t/logstash-configuration-file/112432/2 "2017-12-20T18:49:54Z")

</div>

Looks like a job for: [https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-merge](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-merge)

---

<div class="post-metadata">

### Author: ![Amir\_P](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@Amir\_P](https://discuss.elastic.co/u/Amir_P)
#### Post date: [December 21, 2017, 9:55pm UTC](https://discuss.elastic.co/t/logstash-configuration-file/112432/3 "2017-12-21T21:55:20Z")

</div>

Well I finally solved it, most of the code written on the sql server side, but the mutate did help a little.  
Thanks for the help 🙂

---

<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 18, 2018, 9:55pm UTC](https://discuss.elastic.co/t/logstash-configuration-file/112432/4 "2018-01-18T21:55:31Z")

</div>

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