All Apps and Add-ons

Why is Linux script data showing the correct output but not getting correct data?

SK2
Loves-to-Learn

Configured the script based app for the databases which brings the data as follows. As mentioned below. 

When I am running the script at UF corrected expeced output. But when I push an application containg the same script it is fetching me different output.

Expected data after running the script in the UF is as below. 
Date, datname="sql", age="00:00:00"

Output we are receiving at splunk SH is like below. 
Date, datname="datname", age="age"

The script is kept in the location -> /opt/splunkforwarder/etc/apps/appname/bin - scripts  and /opt/splunkforwarder/etc/apps/appname/local - inputs.conf

For troubleshooting I have followed below steps. 
Removed and Pushed the app again
Tried restarting the UF

Can any one know or faced similar issue.
Please help me on this. 

Labels (3)
Tags (2)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

you could debug it with "splunk" user with next command

splunk cmd /opt/splunkforwarder/etc/apps/appname/bin - scripts

This is the way how it has ran as scripted input.

r. Ismo 

0 Karma

shivanshu1593
Builder

Oddly enough your script is messing up while writing the output to stdout. Can you try by outputting the data in a txt file and monitor that txt file and see what results you get, instead of trying to write it to stdout or share a snippet of your script.

++If this helps, please consider accepting as an solution++

Thank you,
Shiv
###If you found the answer helpful, kindly consider upvoting/accepting it as the answer as it helps other Splunkers find the solutions to similar issues###
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...