For now. you may want to take a look at the :sql_last_start
computed parameter. This field represents the last time (in current time) for which a sql statement was run. So if your timestamps are based on real time as well, this may work for you.
you can set it up like this:
input {
jdbc {
...
statement => "select * from table where timestamp > :sql_last_start"
schedule => "* * * * *"
}
}
This input configuration will only fetch latest records and run according to this cron-like schedule which means "run every minute, on the minute". By adding a schedule, the input plugin will stay alive and run the query every minute.
Regarding postgresql. this plugin supports that. You just have to download the driver jars yourself from here: https://jdbc.postgresql.org/download.html. and configure the jdbc_driver_library
with the path of the downloaded driver. And set the jdbc_driver_class
option to org.postgresql.Driver
.
does that make sense? for a number of reasons, we chose not to include these jars within the plugin itself.