Logstash synchronization with postgresql

(Iremsu) #1

Hi all,
I am new on elk stack. I am using postgresql and the thing that i am trying to do it: i have a table called testtable with two columns key and value; whenever i add something in to these columns in my database i want it to be seen from logstash, i have a .conf file and inside of it i put a line:
statement => "select * from testtable"
It is working to pick the table but when i just want to insert just one value it will always take again and again all the database table. So is there a way for logstash to take just once the all table and then whenever i insert just the inserted ones?
Thank you

(David Pilato) #2

Have a look at https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_predefined_parameters

And use sql_last_value.

(Iremsu) #3

Hello,i used sql last value but it takes the value as integer,not a day even though i used the tracking column as a date column, how can i fix this?

(system) #4

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