Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I've been working on the idea of dynamic parameters related to #51. The config could be extended as follows:
This means that
min_id
parameter of query will be populated withmax_id
field from the parsed event. I've never written Ruby code before, but it's quite fun. I know the tests are missing, but if you confirm that this can be potentially merged (seems to be quite popular feature), I will write tests.One of the potential problems is that the request's
spec
now becomes populated with some extra variables, such aswhich might not be desirable, but I could not put them in the request object directly because
logstash/plugin_mixins/http_client
expects only 2 elements.Another issue is that at the moment dynamic parameters are hard-coded to go into
query
property (and creating one if it does not exist), and notparams
which would be required forPOST
/ other methods. Also they will override original query parameters specified in the config, but I guess this can be desirable.Some implementation details had been taken almost directly from logstash-jdbc-input.
So yeah, let me know if it's cool and I'll write some tests / make suggested improvements. Cheers!
Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/