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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...