I have the same question. Now I figure it out. I think it will help you.
We misunderstand the definition of Field and Option.
So we miss the important property named fieldnames that defined in splunklib/searchcommands/search_command.py Line:201
Following code is what you want. Line 8-9
@Configuration()
class GenerateTextCommand(GeneratingCommand):
# options
.....
def generate(self):
# field names
count = self.fieldnames[0]
text = self.fieldnames[1]
for i in range(1, self.count + 1):
yield {'_serial': i, '_time': time.time(), '_raw': six.text_type(i) + '. ' + text}
Thank you.
... View more