I have an example of a custom python script for displaying events from db in the splunk, help with the same example how to do this for Java? import sys, time
from splunklib.searchcommands import \
dispatch, GeneratingCommand, Configuration, Option, validators
@Configuration()
class GenerateHelloCommand(GeneratingCommand):
count = Option(require=True, validate=validators.Integer())
def generate(self):
for i in range(1, self.count + 1):
text = 'Hello World %d' % i
yield {'_time': time.time(), 'event_no': i, '_raw': text }
dispatch(GenerateHelloCommand, sys.argv, sys.stdin, sys.stdout, __name__)
... View more