Custom search command examples

The Splunk SDK for Python contains example custom search commands. Use these examples as a guide for writing your custom search command Python script.

The custom search command examples are located in the searchcommands_app sample app in the SDK. To download these examples, see the Splunk SDK Python repository on GitHub.

The Splunk SDK for Python contains the following example custom search commands.

Command Name Command Type Description
filter Eventing Filters records from the events stream based on user-specified criteria.
generatehello Generating Generates the number of simple events that you specify in the count argument with the string 'hello'.
generatetext Generating Generates the number of simple events that you specify in the count argument with the text that you specify in the text argument.
simulate Generating Generates a sequence of events from a CSV file using repeated random sampling.
sum Reporting Calculates the sum of a set of records.
countmatches Streaming Counts the number of non-overlapping matches to a regular expression in a set of fields.


Next Steps

See Python classes for custom search commands.