Splunk Search

Couldn't run script command

EdSplunk
Explorer

Based on reference: http://www.splunk.com/base/Documentation/4.2/SearchReference/Script

I created a perl file that just outputs the arguments to a file. I called it test.pl and saved it under splunk_home/etc/searchscripts (I had to create the directory since it didn't exist).

I built my search

permit dst=192.* | stats count dst | script perl test.pl

but I keep getting an error:

Error in 'script' command: The external search command 'test.pl' does not exist in commands.conf.

Can anyone point me in the right direction?

Tags (3)

dwaddle
SplunkTrust
SplunkTrust

Based on the error, your script needs to be defined in commands.conf, something similar to:

[test]
FILENAME = test.pl

See http://www.splunk.com/base/Documentation/latest/Admin/Commandsconf for details on commands.conf, and http://www.splunk.com/base/Documentation/latest/SearchReference/Aboutcustomsearchcommands for more details about defining your custom search command.

echalex
Builder

The error message certainly suggests you need to put this in commands.conf. However, the documentation for script doesn't mention that. Furthermore, having the script in commands.conf makes using the script command redundant.

0 Karma

malbertdr
Explorer

I don't believe perl is currently supported. Only python.

0 Karma

EdSplunk
Explorer

Actually, it is, based on the said reference.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...