I believe that the yield in generate2 is "yielded" to genetate, however this does not do anything with it, instead, depending what you're trying to achieve, you may be able to do: import sys, time
from splunklib.searchcommands import \
dispatch, GeneratingCommand, Configuration, Option, validators
@Configuration()
class GenerateHelloCommand(GeneratingCommand):
count = Option(require=True, validate=validators.Integer())
def generate2(self):
yield {'_time': time.time(), 'event_no': 2, '_raw': "hello 2"}
def generate(self):
yield self.generate2()
yield {'_time': time.time(), 'event_no': 1, '_raw': "hello"}
dispatch(GenerateHelloCommand, sys.argv, sys.stdin, sys.stdout, __name__)
... View more