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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...