<?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: Python example fails in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Python-example-fails/m-p/15031#M1735</link>
    <description>&lt;P&gt;FYI, a similar problem on the Windows platform required running a script &lt;CODE&gt;C:\Program Files\Splunk\etc\apps\TA-uas_parser\bin\update_cache.py&lt;/CODE&gt; as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;%SPLUNK_HOME%\bin\splunk cmd python update_cache.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"%SPLUNK_HOME%"\bin\splunk cmd python update_cache.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Depending on how you have quoted your splunk_home path.  &lt;/P&gt;</description>
    <pubDate>Thu, 24 Jul 2014 16:22:00 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2014-07-24T16:22:00Z</dc:date>
    <item>
      <title>Python example fails</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Python-example-fails/m-p/15029#M1733</link>
      <description>&lt;P&gt;I know this is probably because I am not a Python expert and I have done something wrong, but when I try to run your Python Example of how to create a search (http://www.splunk.com/base/Documentation/latest/Developer/RESTCreateSearch), I get this:&lt;/P&gt;

&lt;PRE&gt;
[root@splunk ~]# python test.py

/opt/splunk/lib/python2.6/site-packages/httplib2/__init__.py:47: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  File "test.py", line 4, in 
    import httplib2
  File "/opt/splunk/lib/python2.6/site-packages/httplib2/__init__.py", line 47, in 
    import sha
  File "/opt/splunk/lib/python2.6/sha.py", line 10, in 
    from hashlib import sha1 as sha
  File "/opt/splunk/lib/python2.6/hashlib.py", line 136, in 
    md5 = __get_builtin_constructor('md5')
  File "/opt/splunk/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5
&lt;/PRE&gt;

&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2010 05:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Python-example-fails/m-p/15029#M1733</guid>
      <dc:creator>rmarshall</dc:creator>
      <dc:date>2010-06-08T05:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python example fails</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Python-example-fails/m-p/15030#M1734</link>
      <description>&lt;P&gt;You need to set the Splunk environment first. The easiest way is to invoke python using &lt;CODE&gt;$SPLUNK_HOME/bin/splunk cmd python test.py&lt;/CODE&gt;. You could also do (in &lt;CODE&gt;bash&lt;/CODE&gt; or &lt;CODE&gt;sh&lt;/CODE&gt;) &lt;CODE&gt;source $SPLUNK_HOME/bin/setSplunkEnv&lt;/CODE&gt;, then call &lt;CODE&gt;python test.py&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2010 06:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Python-example-fails/m-p/15030#M1734</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-06-08T06:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python example fails</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Python-example-fails/m-p/15031#M1735</link>
      <description>&lt;P&gt;FYI, a similar problem on the Windows platform required running a script &lt;CODE&gt;C:\Program Files\Splunk\etc\apps\TA-uas_parser\bin\update_cache.py&lt;/CODE&gt; as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;%SPLUNK_HOME%\bin\splunk cmd python update_cache.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"%SPLUNK_HOME%"\bin\splunk cmd python update_cache.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Depending on how you have quoted your splunk_home path.  &lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2014 16:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Python-example-fails/m-p/15031#M1735</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2014-07-24T16:22:00Z</dc:date>
    </item>
  </channel>
</rss>

