Getting Data In

Accessing bash variables via a universal forwarder scripted input

pholderness
New Member

When using a shell script on my splunk server I am able to access variables with no problem ie

#!/bin/bash
java -jar custom.jar -val $(date +%Y%m%d_%H%M)

However, when using the same script with the Universal Forwarder as a .path file the it does not execute.
Any suggestions on how to achieve this as a scripted input with the UF?

0 Karma

gjanders
SplunkTrust
SplunkTrust

Is it possible you need to use absolute paths to the java and date commands? I'd suspect that the PATH in use by Splunk might not include the location of java (date should work as such).

Alternatively perhaps try set -x in the script and watch to output to see what is happening?

Finally, I'm assuming you have execute permissions on the script...

0 Karma
Get Updates on the Splunk Community!

New This Month - Splunk Observability updates and improvements for faster ...

What’s New? This month, we’re delivering several enhancements across Splunk Observability Cloud for faster and ...

What's New in Splunk Cloud Platform 9.3.2411?

Hey Splunky People! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2411. This release ...

Buttercup Games: Further Dashboarding Techniques (Part 6)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...