Selecting from single column in database table without column name

I am a newbie.

Using Logstash to load data from a database.. The column jasondata contains a json string.

"SELECT jsondata FROM [test].[dbo].[employees]" and in ElasticSearch I get

{"1":223,"firstName":"Standford","lastName":"Gytesham","email":"","gender":"Male","language":"Ndebele","phone":"664-417-5923","university":"Universidad Mayor"},

where jsondata becomes a field in Elastic.
Is it possible to not have the jsondata: ?

You mean you want fields named 1, firstName, lastName and so on instead of jsondata? Use a json filter to process the jsondata field.

Thanks very much that solved it.

An addendum. When I load a row containing
cars": {"car1":"Ford","car2":"BMW","car3":"Fiat"}

it is fine.

When using

"cars":["Ford", "BMW", "Fiat" ]

it ignores the row.

Yes, because the cars field by then has been mapped as an object and then you can't store string data in it.

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