<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to run a python script from a universal forwarder? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609893#M105710</link>
    <description>&lt;P&gt;I wrote a screen scraping script on a server running Splunk Forwarder version 8.2.3. The script is in a file and runs find from the linux command line. It was developed with Python 3.6. I added the script to our Universal Forwarder local inputs.conf and I can see the script is scheduled successfully. However, it consistently fails with a message in the splunkd.log. I have no idea why the message references python3.7. It is not installed anywhere on the system 3.6 is installed in /usr/bin/python3.6. I tried changing the server.conf properties in local by adding "python.version = python3" in the [general] section and restarting, but to no avail. Please advise what else I might try. Thanks. in advance.&lt;/P&gt;
&lt;P&gt;08-18-2022 00:19:45.525 +0000 ERROR ExecProcessor [3423479 ExecProcessor] - message from "python3.7 /opt/splunk/sjcinf8469vmw15/splunkforwarder-8.2.3/splunkforwarder/bin/scripts/scrapeGmrPage.py" /bin/sh: python3.7: command not found&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 16:43:37 GMT</pubDate>
    <dc:creator>marksheinbaum</dc:creator>
    <dc:date>2022-08-22T16:43:37Z</dc:date>
    <item>
      <title>How to run a python script from a universal forwarder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609893#M105710</link>
      <description>&lt;P&gt;I wrote a screen scraping script on a server running Splunk Forwarder version 8.2.3. The script is in a file and runs find from the linux command line. It was developed with Python 3.6. I added the script to our Universal Forwarder local inputs.conf and I can see the script is scheduled successfully. However, it consistently fails with a message in the splunkd.log. I have no idea why the message references python3.7. It is not installed anywhere on the system 3.6 is installed in /usr/bin/python3.6. I tried changing the server.conf properties in local by adding "python.version = python3" in the [general] section and restarting, but to no avail. Please advise what else I might try. Thanks. in advance.&lt;/P&gt;
&lt;P&gt;08-18-2022 00:19:45.525 +0000 ERROR ExecProcessor [3423479 ExecProcessor] - message from "python3.7 /opt/splunk/sjcinf8469vmw15/splunkforwarder-8.2.3/splunkforwarder/bin/scripts/scrapeGmrPage.py" /bin/sh: python3.7: command not found&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 16:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609893#M105710</guid>
      <dc:creator>marksheinbaum</dc:creator>
      <dc:date>2022-08-22T16:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: running a python script from a universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609897#M105711</link>
      <description>&lt;P&gt;If you use ./splunk cmd /pathToScript/&lt;SPAN&gt;scrapeGmrPage.py does it give the same error or different?&lt;BR /&gt;&lt;BR /&gt;Splunk ships with its own python3 parser in its splunk/bin directory, and should be using that to run scripts if it's being run by Splunk.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You may have an environment variable problem with $SPLUNK_HOME or there could&amp;nbsp; be an absolute path somewhere.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 03:03:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609897#M105711</guid>
      <dc:creator>chaker</dc:creator>
      <dc:date>2022-08-18T03:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: running a python script from a universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609898#M105712</link>
      <description>&lt;P&gt;The script runs fine when I run as you suggested.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;./splunk cmd ~/sjcinf8469vmw15/splunkforwarder/bin/scripts/scrapeGmrPage.py&lt;/P&gt;&lt;P&gt;BTW, I do not see any python interpreters in the splunk bin directory. Not sure if that is relevant:&lt;/P&gt;&lt;P&gt;pwd&lt;BR /&gt;/opt/splunk/sjcinf8469vmw15/splunkforwarder/bin&lt;/P&gt;&lt;P&gt;ls&lt;BR /&gt;2to3-3.7 copyright.txt genRootCA.sh openssl pip3 prigreypng priweavepng slim wheel&lt;BR /&gt;btool easy_install genSignedServerCert.sh pid_check.sh pip3.7 pripalpng pydoc3 splunk&lt;BR /&gt;btprobe easy_install-2.7 genWebCert.sh pip pip3.7x pripamtopng pydoc3.7 splunkd&lt;BR /&gt;bzip2 easy_install-3.7 idle3 pip2 prichunkpng pripnglsch scripts splunkmon&lt;BR /&gt;classify fill_test idle3.7 pip2.7 priforgepng pripngtopam setSplunkEnv srm&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 03:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609898#M105712</guid>
      <dc:creator>marksheinbaum</dc:creator>
      <dc:date>2022-08-18T03:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: running a python script from a universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609900#M105713</link>
      <description>&lt;P&gt;My apologies, I gave you bad info about the python3 with Splunk UF. See below&amp;nbsp; link&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Enterprise/Run-Python-scripts-with-universal-forwarder-to-modify-files-on/m-p/524235/highlight/true#M3772" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Enterprise/Run-Python-scripts-with-universal-forwarder-to-modify-files-on/m-p/524235/highlight/true#M3772&lt;/A&gt;&lt;/P&gt;&lt;P&gt;One work around could be to run the script on a cronjob, have it write STDOUT to a file, and use a file montior to capture the output into Splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 03:22:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/609900#M105713</guid>
      <dc:creator>chaker</dc:creator>
      <dc:date>2022-08-18T03:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: running a python script from a universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/610365#M105772</link>
      <description>&lt;P&gt;I answered this previously. Using the splunk cmd with the script and path works fine. Running the script automatically by configuring the input.conf file in&amp;nbsp;../etc/apps/SplunkUniversalForwarder/local/ results in the error&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;08-22-2022 16:14:15.264 +0000 ERROR ExecProcessor [3793782 ExecProcessor] - message from "python3.7 /opt/splunk/sjcinf8469vmw15/splunkforwarder-8.2.3/splunkforwarder/bin/scripts/scrapeGmrPage.py" /bin/sh: python3.7: command not found&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 16:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/610365#M105772</guid>
      <dc:creator>marksheinbaum</dc:creator>
      <dc:date>2022-08-22T16:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: running a python script from a universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/610419#M105778</link>
      <description>&lt;P&gt;- If you want Splunk to run your script, put it in a shell script and call the systems /usr/bin/python. Then you can use the script input on the UF to capture the output.&lt;BR /&gt;&lt;BR /&gt;- Alternatively, you can run the script on the systems cron scheduler, and output the contents to a file, then have Splunk monitor that file.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 01:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-run-a-python-script-from-a-universal-forwarder/m-p/610419#M105778</guid>
      <dc:creator>chaker</dc:creator>
      <dc:date>2022-08-23T01:37:30Z</dc:date>
    </item>
  </channel>
</rss>

