Databases Reference
In-Depth Information
max = getInt(options, 'max', 1000000)
eventcount = getInt(options, 'eventcount', 100)
results = []
for r in range(0, eventcount):
results.append({'r': randint(min, max)})
si.outputResults(results)
except Exception, e:
import traceback
stack = traceback.format_exc()
si.generateErrorResults("Error '%s'. %s" % (e, stack))
The entry in commands.conf then is as follows:
[randomgenerator]
filename = random_generator.py
generating = true
We can then use the command as follows:
|randomgenerator
Notice the leading pipe | symbol. This is the indication to run a command instead
of running a search. Let's test the randomness of our Python:
|randomgenerator eventcount=100000 min=100 max=899
| bucket r
| chart count by r
This produces a graph, as shown in the following screenshot:
 
Search WWH ::




Custom Search