Logstash configuration file


(Amir Peres) #1

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!


#2

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


(Amir Peres) #3

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 :slight_smile:


(system) #4

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