No, I haven't removed the condition in the prepare fuction...
The (reporting command) template show nothing about it:
from splunklib.searchcommands import \
dispatch, ReportingCommand, Configuration, Option, validators
def map(self, events):
# Put your streaming preop implementation here, or remove the map method,
# if you have no need for a streaming preop
def reduce(self, events):
# Put your reporting implementation
dispatch(%(command.title())Command, sys.argv, sys.stdin, sys.stdout, __name__)
and the prepare function is only found in the ReportingCommand class (splunklib/searchcommands/reporting_command.py) without info about overriding the prepare function...
I tried to remove the map section completely, or keep the return only, but it doesn't help. It triggers other errors:
with only return:
/splunklib/searchcommands/internals.py", line 519 : 'NotImplementedType' object is not iterable
(which shows that it tries to use the map() function of the base class, which returns "NotImplemented")
without the if phase=='map' section:
It triggers the exception, as the phase is not recognised.
So basically, I think I need to implement a dummy map function that does nothing. Any idea how this would look like?
... View more