Hi there,
I've encountered the same issue as @wmedlen. I have two jdbc inputs, two distinct tables with their own ID-s and only 1 sql_last_value parameter gets stored in the .logstash_jdbc_last_run file. From your comment @magnusbaeck I realize in this case we should have two distinct metadata paths specified by which every statement will use it's own value, so thanks for clarifying. I am pretty sure that most people with multiple jdbc inputs will run into the same problem, since all the solutions on stackoverflow etc. mention adding multiple inputs but none of them mentions how to deal with the sql_last_value and the last_run_metadata_path in this case.
The funny thing is that everything's been working fine for quite a a while, apparently because it was always the lower ID from the two tables that was being saved. Only after a recent server restart have the things "turned around" and I realized that something was fishy, since recent records from one table were missing.
Although it (now
) makes total sense and there is an obvious workaround, I would suggest to
a) either update the docs to include some instructions regarding handling multiple inputs in one file or
b) change the behaviour of the plugin to keep separate per-input sql_last_value parameters.
If you think a) is enough I could go ahead and prepare a PR for the docs part. Let me know what you think.
Thanks in advance!