feat: pass modular input script as parameter to input helper stream_e… #1342
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.
Summary
Change input helper templates to also pass the
modular_input
instance (smi.Script
) to thestream_events
function. This makes it easier to interact with Splunk, because the Splunk service of themodular_input
instance can be used.Changes
Added a additional parameter
modular_input
to the stream_events function of the input helper. Within the input itself, it is checked, if thestream_events
function expects three parameters or not. If three parameters are expected, self will be passed asmodular_input
.This is the least intrusive approach to implement this feature, but it has the overhead to check the amount of function parameters on each execution. Due to that, all prior implementation which doesn't have the parameter also work and no additional config parameter is necessary.
If you think an additional config parameter would be the better approach, I can implement this as well.
User experience
The user can access the
modular_input
within the input helper as well.Checklist
If your change doesn't seem to apply, please leave them unchecked.