Getting Data In

Perl script output instead of shell

yadvendra
New Member

Hello There,

I wanted to use Perl script instead of shell script for the scripted output.

I put my shell perl script @ same place where other shell scripts are available.

but I am not able to get input from Perl script in splunk.

Kindly help!!

Following is the output of my perl script, which I want in splunk

mm174:/var/tmp/yad/splunk/etc/apps/Mediation/bin# /var/tmp/yad/read_bgwConfig.pl
SERVER INBUFFER OUTBUFFER
Telstra 0 2
ServerNN 0 0
Server2 0 2
Server3 0 0
Server1 4 6
Server4 0 0

Tags (2)
0 Karma

yadvendra
New Member

Thanks a Lot for your help!

Well I was able to run the scripts from the directories.

However was confused if I can user perl script or not for the same.

Now I am able to use Perl Script and getting the output in the splunk

Thanks For your help

0 Karma

linu1988
Champion

if you have the script and it's echoing you some output in the window then it will be sent to splunk

0 Karma

jpass
Contributor

Would you please post the answer so other visitors looking for the same solution can find it? I'm trying to do the same thing myself. I've done this previously but didn't need to return anything back to splunk. Now I need to return the output of the script back to splunk.

0 Karma

Ayn
Legend

Your script needs to reside inside a directory that Splunk allows script execution in. From the inputs.conf docs:

[script://<cmd>]
* Runs <cmd> at a configured interval (see below) and indexes the output.  
* The <cmd> must reside in one of 
  *  $SPLUNK_HOME/etc/system/bin/
  *  $SPLUNK_HOME/etc/apps/$YOUR_APP/bin/
  *   $SPLUNK_HOME/bin/scripts/

yadvendra
New Member

I also tried to call it like this

sb6270x1813:/var/tmp/yad/splunk/etc/apps/Mediation/bin# cat fe_buffer.sh

!/bin/bash

perl read_bgwConfig.pl

However did not work.

0 Karma
Get Updates on the Splunk Community!

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 ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...