<?xml version="1.0" ?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
	<channel>
		<title>Splunk Base : SplunkGeneral : #4138</title>
		<link>http://www.splunk.com/support/forum:SplunkGeneral/4138</link>
		<description></description>
		<pubDate>Mon, 13 Feb 2012 12:08:30 PST</pubDate>
		<lastBuildDate>Mon, 13 Feb 2012 12:08:30 PST</lastBuildDate>
		<language>en-us</language>
		<copyright>http://creativecommons.org/licenses/by-nc-nd/2.5/</copyright>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13837</link>
			<description>&lt;p&gt;How to use relative address in subprocess.Popen. I used the following code but it failed.&lt;br /&gt;
p = subprocess.Popen(['/usr/bin/python', './dbtestlookup.py', cityf, countryf], .......&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

</description>
			<pubDate>Fri, 26 Mar 2010 00:47:11 PDT</pubDate>
			<author>dianbo</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13837</guid>
		</item>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13694</link>
			<description>&lt;p&gt;thank you very much.&lt;br /&gt;
i am a beginner of Python. thank you for your detailed explanation.&lt;/p&gt;

</description>
			<pubDate>Wed, 17 Mar 2010 08:31:51 PDT</pubDate>
			<author>dianbo</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13694</guid>
		</item>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13626</link>
			<description>&lt;p&gt;Per the answers post, did you unset the required env variables?  It does not look like you did based on above.&lt;/p&gt;

&lt;p&gt;You will probably need to do something like this:&lt;/p&gt;


&lt;div class=&quot;wikiCode&quot;&gt;&lt;pre&gt;

#!/opt/splunk/bin/python
import os,sys,subprocess

os.unsetenv(&amp;quot;PYTHONPATH&amp;quot;)
os.unsetenv(&amp;quot;PATH&amp;quot;)
os.unsetenv(&amp;quot;LD_LIBRARY_PATH&amp;quot;)

p = subprocess.Popen(['/usr/bin/python', '/opt/splunk/etc/apps/search/bin/dbtestlookup.py', cityf, countryf],stdin=subprocess.PIPE,stdout=subprocess.PIPE)

so = p.communicate(&amp;quot;&amp;quot;.join(sys.stdin.readlines()))
for o in so:
  if o:
    print o
&lt;/pre&gt;&lt;/div&gt;

</description>
			<pubDate>Fri, 12 Mar 2010 07:42:59 PST</pubDate>
			<author>araitz</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13626</guid>
		</item>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13618</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I tried the following code but did not see the lookup result.&lt;br /&gt;
//dbtestlookupwrapper.py&lt;br /&gt;
mycmd_ = ['/usr/bin/python', '/opt/splunk/etc/apps/search/bin/dbtestlookup.py', cityf, countryf]&lt;br /&gt;
subprocess.Popen(mycmd_, stdin = None, stdout = None, stderr = None, shell = False).wait()&lt;/p&gt;

&lt;p&gt;2 questions:&lt;/p&gt;

&lt;p&gt;how to set relative address for the python script?&lt;br /&gt;
where is the error information log file when failed to execute lookup script?&lt;/p&gt;

&lt;p&gt;Thanks &amp;amp; regards.&lt;br /&gt;
Dianbo&lt;/p&gt;

</description>
			<pubDate>Fri, 12 Mar 2010 02:17:12 PST</pubDate>
			<author>dianbo</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13618</guid>
		</item>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13612</link>
			<description>&lt;p&gt;According to the Splunk Answers thread above, it is not supported to install 3rd party python modules within Splunk.  The best practice is to use a wrapper script such as is described in Amrit's post on that thread.&lt;/p&gt;

</description>
			<pubDate>Thu, 11 Mar 2010 09:07:19 PST</pubDate>
			<author>araitz</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13612</guid>
		</item>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13611</link>
			<description>&lt;p&gt;it is the same.&lt;/p&gt;

&lt;p&gt;[root@localhost bin]# ./splunk cmd /local/dl/setuptools-0.6c11-py2.6.egg Traceback (most recent call last): File &amp;quot;&amp;quot;, line 1, in File &amp;quot;/local/dl/setuptools-0.6c11-py2.6.egg/setuptools/init.py&amp;quot;, line 2, in File &amp;quot;/local/dl/setuptools-0.6c11-py2.6.egg/setuptools/extension.py&amp;quot;, line 2, in File &amp;quot;/local/dl/setuptools-0.6c11-py2.6.egg/setuptools/dist.py&amp;quot;, line 5, in File &amp;quot;/local/dl/setuptools-0.6c11-py2.6.egg/setuptools/command/init.py&amp;quot;, line 13, in &lt;a class=&quot;wiki_url_new&quot; href=&quot;/base/ImportError&quot;&gt;ImportError&lt;/a&gt;: No module named command.bdist&lt;/p&gt;

&lt;p&gt;[root@localhost bin]# ./splunk cmd /local/dl/&lt;a class=&quot;wiki_url&quot; href=&quot;/base/MySQL&quot;&gt;MySQL&lt;/a&gt;_python-1.2.3c1-py2.6-linux-i686.egg couldn't run &amp;quot;/local/dl/&lt;a class=&quot;wiki_url&quot; href=&quot;/base/MySQL&quot;&gt;MySQL&lt;/a&gt;_python-1.2.3c1-py2.6-linux-i686.egg&amp;quot;: Exec format error&lt;/p&gt;

</description>
			<pubDate>Thu, 11 Mar 2010 08:08:59 PST</pubDate>
			<author>dianbo</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13611</guid>
		</item>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13578</link>
			<description>&lt;p&gt;Try &lt;tt&gt;./splunk cmd python setup.py build&lt;/tt&gt;  from &lt;a href=&quot;http://answers.splunk.com/questions/8/can-i-add-python-modules-to-the-splunk-environment&quot; onclick=&quot;window.open(this.href, '_blank'); return false;&quot;&gt;http://answers.splunk.com/questions/8/can-i-add-python-modules-to-the-splunk-environment&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Rui&lt;/p&gt;

</description>
			<pubDate>Wed, 10 Mar 2010 04:16:25 PST</pubDate>
			<author>rataide</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13578</guid>
		</item>
		<item>
			<title>fail to set up MySQLdb</title>
			<link>http://www.splunk.com/support/forum:SplunkGeneral/4138/13577</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I want to do lookup from mysql database. the python in my linux is python 2.3, and i installed splunk 3.4 and splunk 4.0, so there are 3 pythons in the server -- 2.3, 2.5 and 2.6.&lt;/p&gt;

&lt;p&gt;I want to append mysqldb to python 2.6. The following are the steps and console messages.&lt;br /&gt;
&lt;strong&gt;cd &lt;a class=&quot;wiki_url&quot; href=&quot;/base/MySQL&quot;&gt;MySQL&lt;/a&gt;-python-1.2.3c1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;python2.6 setup.py build&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;&lt;a class=&quot;wiki_url_new&quot; href=&quot;/base/ImportError&quot;&gt;ImportError&lt;/a&gt;: No module named setuptools&lt;/p&gt;

&lt;p&gt;&lt;strong&gt; sh setuptools-0.6c11-py2.6.egg&lt;/strong&gt;&lt;br /&gt;
&lt;/em&gt;&lt;a class=&quot;wiki_url_new&quot; href=&quot;/base/ImportError&quot;&gt;ImportError&lt;/a&gt;: No module named command.bdist&lt;/p&gt;

&lt;p&gt;Anyone can help? Thanks,&lt;/p&gt;

&lt;p&gt;//Note: it goes well when install setuptools and mysqldb to the local python 2.3.&lt;/p&gt;

&lt;p&gt;Dianbo&lt;/p&gt;

</description>
			<pubDate>Wed, 10 Mar 2010 00:58:16 PST</pubDate>
			<author>dianbo</author>
			<guid>http://www.splunk.com/support/forum:SplunkGeneral/4138/13577</guid>
		</item>
	</channel>
</rss>

