JDBC input plugin to feed JSON from database table


(Chinmoy Das) #1

I need to feed JSON data from a PostGreSQL table as input to logstash. For this, I shall use the JDBC input plugin. In Kibana I need to display only selective fields from this JSON. So, somewhere I need to parse this JSON.

From the documentation, it appears to me that the json codec plugin in logstash can help me to achieve the same. Can you please provide some example of the json codec plugin?


(Craig Foote) #2

I'm not sure I understand the problem but I'll give it a try. I've used the JDBC Logstash input plugin with Oracle and MySQL DBs. The plugin handles the creation of the JSON (by default using the JSON codec I guess), creating a field for each column. I've been able to manage the number of fields by using the SELECT statement identifying only the columns I want.


(Mark Walkom) #3

Have you seen https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html?


(Chinmoy Das) #4

Thanks


(system) #5