How to do it...

Perform the steps in this recipe to create a custom search command to format product names:

  1. Open a console terminal on your Splunk server.
  2. Change to the directory where you downloaded the Splunk Python SDK.
  3. Expand the ZIP file using an appropriate tool located on your Splunk server.
  4. Copy the splunk-sdk-python-X.X.X/splunklib (replace the Xes with your correct SDK version) directory into $SPLUNK_HOME/etc/apps/operational_intelligence/bin.
  1. Create and add the following code to commands.conf located in the $SPLUNK_HOME/etc/apps/operational_intelligence/local directory:
[fixname] 
filename = fixname.py 
supports_getinfo = true 
supports_rawargs = true 
outputheader = true 
requires_srinfo = true 
  1. In $SPLUNK_HOME/etc/apps/operational_intelligence/bin ...

Get Splunk Operational Intelligence Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.