Splunk Dev

Scripted input strange behavior

a_naoum
Path Finder

Good to all,
I have a strange behavior of a python script. The specific python script collects some AWS data. if I run it as it is, it works nicely. If I run through Splunk's python (bin/splunk python) it also runs. If I schedule it, I get errors related to access to AWS.
Especially with the second try (via Splunk's python) I had the impression that I could "emulate" how it will run when it is going to be enabled but appears that that is not the case.
Is there any other way to troubleshoot this?

Labels (1)
0 Karma

PavelP
Motivator

Hello @a_naoum

a script running under $SPLUNK_HOME/bin/splunk cmd python should have similar environment as your scheduled script, so probably you run it as a different user (root?).

Use the common way to troubleshoot, just add some print here and there, especially before the code part where AWS request is done, additionally print the raw response.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...