<?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 Re: why the Python can be ran by alert, but can not ran manually in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/why-the-Python-can-be-ran-by-alert-but-can-not-ran-manually/m-p/517839#M9230</link>
    <description>&lt;P&gt;It works, thank you for your help!&lt;/P&gt;</description>
    <pubDate>Fri, 04 Sep 2020 01:39:13 GMT</pubDate>
    <dc:creator>michael_wong</dc:creator>
    <dc:date>2020-09-04T01:39:13Z</dc:date>
    <item>
      <title>why the Python can be ran by alert, but can not ran manually</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/why-the-Python-can-be-ran-by-alert-but-can-not-ran-manually/m-p/517629#M9228</link>
      <description>&lt;P&gt;I have a script that can be ran with alert, but if I run the script manually, the following error will showed. Any idea how I can run it manually?&lt;/P&gt;&lt;P&gt;I have add the python location in first line.&lt;/P&gt;&lt;P&gt;#!/data/splunk/bin/python&lt;/P&gt;&lt;P&gt;[root@hostname scripts]# ./REST_1.py&lt;BR /&gt;ERROR:root:code for hash sha1 was not found.&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "/data/splunk/lib/python2.7/hashlib.py", line 147, in &amp;lt;module&amp;gt;&lt;BR /&gt;globals()[__func_name] = __get_hash(__func_name)&lt;BR /&gt;File "/data/splunk/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor&lt;BR /&gt;raise ValueError('unsupported hash type ' + name)&lt;BR /&gt;ValueError: unsupported hash type sha1&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "./REST_1.py", line 7, in &amp;lt;module&amp;gt;&lt;BR /&gt;import requests&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/__init__.py", line 58, in &amp;lt;module&amp;gt;&lt;BR /&gt;from . import utils&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/utils.py", line 25, in &amp;lt;module&amp;gt;&lt;BR /&gt;from .compat import parse_http_list as _parse_list_header&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/compat.py", line 7, in &amp;lt;module&amp;gt;&lt;BR /&gt;from .packages import chardet&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/packages/__init__.py", line 3, in &amp;lt;module&amp;gt;&lt;BR /&gt;from . import urllib3&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/packages/urllib3/__init__.py", line 16, in &amp;lt;module&amp;gt;&lt;BR /&gt;from .connectionpool import (&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 36, in &amp;lt;module&amp;gt;&lt;BR /&gt;from .connection import (&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 43, in &amp;lt;module&amp;gt;&lt;BR /&gt;from .util import (&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/packages/urllib3/util/__init__.py", line 10, in &amp;lt;module&amp;gt;&lt;BR /&gt;from .ssl_ import (&lt;BR /&gt;File "/data/splunk/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;from hashlib import md5, sha1&lt;BR /&gt;ImportError: cannot import name sha1&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 04:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/why-the-Python-can-be-ran-by-alert-but-can-not-ran-manually/m-p/517629#M9228</guid>
      <dc:creator>michael_wong</dc:creator>
      <dc:date>2020-09-03T04:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: why the Python can be ran by alert, but can not ran manually</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/why-the-Python-can-be-ran-by-alert-but-can-not-ran-manually/m-p/517730#M9229</link>
      <description>&lt;P&gt;When running your scripts manually, be sure to do so in the Splunk environment.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;splunk cmd python REST_1.py&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Sep 2020 13:28:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/why-the-Python-can-be-ran-by-alert-but-can-not-ran-manually/m-p/517730#M9229</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-03T13:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: why the Python can be ran by alert, but can not ran manually</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/why-the-Python-can-be-ran-by-alert-but-can-not-ran-manually/m-p/517839#M9230</link>
      <description>&lt;P&gt;It works, thank you for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 01:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/why-the-Python-can-be-ran-by-alert-but-can-not-ran-manually/m-p/517839#M9230</guid>
      <dc:creator>michael_wong</dc:creator>
      <dc:date>2020-09-04T01:39:13Z</dc:date>
    </item>
  </channel>
</rss>

