How to execute a py or sh by interface of Splunk

Path Finder


I write a in the /splunk/etc/apps/my_apps/bin and by the commande line


to execute the code.

Could I add a bouton or something else in the interface of my app in Splunk
alt text

to trigger the

Thank you very much

0 Karma


This is what I did
Put my custom python script in this folder

import csv
import sys
import splunk.Intersplunk
import string
(isgetinfo, sys.argv) = splunk.Intersplunk.isGetInfo(sys.argv)
if len(sys.argv) < 2:
splunk.Intersplunk.parseError("No arguments provided to custom script")

results = splunk.Intersplunk.readResults(None, None, True)

Modify commands.conf file in below folder

defaults for all external commands, exceptions are below in individual stanzas

type of script: 'python', 'perl'

TYPE = python

default FILENAME would be .py for python, .pl for perl and otherwise

is command streamable?


maximum data that can be passed to command (0 = no limit)


end defaults

filename =

To reload the setting run this URL in your browser (Just in case, if required)

And this is how we can use custom command in splunk
| customtest GETINFO [Inputparameters]

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!