Getting Data In

Issue Executing Python Script on Windows UF

dianasmith
Loves-to-Learn

I'm having an issue running a python script to generate the contents of an email body to splunk.

I've had to install a Windows UF to a Windows 10 workstation as local admin.

I've deployed a python script that works when I manually run it on the Workstation.

Since Splunk UFs don't come with Python, I downloaded Python separately and added an environmental variable and path. I consistantly get the following messages:

Couldn't start command "Python3.exe "C:\Program Files\SplunkUniversalForwarder\bin\scripts\script1.py"": The system cannot find the file specified.

Couldn't start command "Python3.exe "C:\Program Files\SplunkUniversalForwarder\etc\apps\custom-app\bin\script2"": The system cannot find the file specified.

I've tried:

  1. Adding PYTHONPATH to splunk-launch.conf for external
  2. Adding .bat wrapper
  3. Tried .cmd 
  4. Tried Powershell
  5. Installing and deploying Splunk for Python Computing and adding the full path of python to the .bat files

@woodcock do you have any suggestions? Anyone? Any suggestions?

Labels (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Rather than jump through those (unsupported) hoops, why not replace the UF with a HF?  It comes with Python.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...