<?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: External lookup command in Windows in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10051#M247</link>
    <description>&lt;P&gt;You could use PyODBC, which has a 64-bit windows build.  It looks like it installs only a few files into Python\lib\site-packages, which could probably be copied into $SPLUNK_HOME\lib\Python2.6\site-packages&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2010 02:09:41 GMT</pubDate>
    <dc:creator>Jason</dc:creator>
    <dc:date>2010-10-27T02:09:41Z</dc:date>
    <item>
      <title>External lookup command in Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10049#M245</link>
      <description>&lt;P&gt;I have an external lookup script (written in python) that uses the pymssql module to query a SQL Server 2005 database. The script works with a 32bit python interpreter but my splunk instances are all running on Windows x64 and pymssql won't run with a 64bit python so I'm a bit hosed.&lt;/P&gt;

&lt;P&gt;As I see it, I have two options:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;I can specify that splunk use a python interpreter other than the one it ships with&lt;/LI&gt;
&lt;LI&gt;Find another way to query a Microsoft SQL server from the built-in python&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I have no idea how to go about accomplishing either. Has anyone figured out how to query a SQL Server 2005 database from an external lookup script on x64? &lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2010 01:29:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10049#M245</guid>
      <dc:creator>izzy</dc:creator>
      <dc:date>2010-03-09T01:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: External lookup command in Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10050#M246</link>
      <description>&lt;P&gt;I think you want to just run the external python interpreter.&lt;/P&gt;

&lt;P&gt;Something like this, treat as pseudocode.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import os, sys

if "PYTHONPATH" in os.environ:
    del os.environ["PYTHONPATH"]
if "LD_LIBRARY_PATH" in os.environ:
    del os.environ["LD_LIBRARY_PATH"]

os.execv(your_python_interpreter, [your_python_interpreter, your_script] + sys.argv[1:])
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Mar 2010 05:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10050#M246</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2010-03-09T05:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: External lookup command in Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10051#M247</link>
      <description>&lt;P&gt;You could use PyODBC, which has a 64-bit windows build.  It looks like it installs only a few files into Python\lib\site-packages, which could probably be copied into $SPLUNK_HOME\lib\Python2.6\site-packages&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 02:09:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10051#M247</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2010-10-27T02:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: External lookup command in Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10052#M248</link>
      <description>&lt;P&gt;Jason,
As per your suggestion if i copy files from PyODBC,  64-bit windows build  i.e.  Python\lib\site-packages, to $SPLUNK_HOME\lib\Python2.6\site-packages.&lt;/P&gt;

&lt;P&gt;Would i be able to call external database lookup script from Splunk? Or i need to do more tweaks?&lt;/P&gt;

&lt;P&gt;Please note i have database lookup script written using Python 2.7 because pyodbc has 64 bit wndows installation only for Python 2.7 and not for Python 2.6&lt;/P&gt;

&lt;P&gt;So now i am looking for steps to integrate my script with Splunk&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2010 23:46:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10052#M248</guid>
      <dc:creator>bansi</dc:creator>
      <dc:date>2010-12-20T23:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: External lookup command in Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10053#M249</link>
      <description>&lt;P&gt;When I wrote this i probably should have mentioned that you are likely to want to manipulate the PATH environment variable, to select which will win when running additional commands between system binaries, splunk-provided binaries and any custom binaries (eg in usr/local or special paths) in case of name conflict.  &lt;/P&gt;

&lt;P&gt;This is typically relevant for bzip2, python itself, cherryd, the openssl utility program,  node.js's node executable, but but more executables could possibly be added to splunk in the future.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 21:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/External-lookup-command-in-Windows/m-p/10053#M249</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2015-05-13T21:21:35Z</dc:date>
    </item>
  </channel>
</rss>

