<?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: negotiate authentication in custom python search commands in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/negotiate-authentication-in-custom-python-search-commands/m-p/102110#M21406</link>
    <description>&lt;P&gt;I'd suggest using &lt;A href="http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder"&gt;this technique&lt;/A&gt; to include another python library, such as &lt;A href="http://www.python-requests.org/en/latest/"&gt;requests&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;I've also used an alternate technique of shelling out to another script, in this case perl, but you could do so to use system python instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#! /usr/bin/env python
"""
    Python wrapper script for the perl script
"""
import os,sys

script = r'/path/to/my/script.pl'

os.execv(script, sys.argv[1])
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 31 Jul 2013 12:51:53 GMT</pubDate>
    <dc:creator>dart</dc:creator>
    <dc:date>2013-07-31T12:51:53Z</dc:date>
    <item>
      <title>negotiate authentication in custom python search commands</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/negotiate-authentication-in-custom-python-search-commands/m-p/102109#M21405</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'd like to use a custom search command that makes a live REST query to another system with a special account and returns the results to Splunk.  Unfortunately, the other system uses Windows client credentials (my script is running on a Windows search head) and doesn't like basic authentication--the script errors out with a 401 when it tries to open the URL.  With the modules provided in Splunk 4.3.4's Python (Python 2.7.2, I guess), is it possible to make the REST call with another account's credentials without using basic auth?  I've looked for non-Splunk Python code examples, and they either use basic auth or they use the ntlm module, which doesn't appear to be included in Splunk Python by default.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 19:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/negotiate-authentication-in-custom-python-search-commands/m-p/102109#M21405</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2013-01-28T19:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: negotiate authentication in custom python search commands</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/negotiate-authentication-in-custom-python-search-commands/m-p/102110#M21406</link>
      <description>&lt;P&gt;I'd suggest using &lt;A href="http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder"&gt;this technique&lt;/A&gt; to include another python library, such as &lt;A href="http://www.python-requests.org/en/latest/"&gt;requests&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;I've also used an alternate technique of shelling out to another script, in this case perl, but you could do so to use system python instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#! /usr/bin/env python
"""
    Python wrapper script for the perl script
"""
import os,sys

script = r'/path/to/my/script.pl'

os.execv(script, sys.argv[1])
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jul 2013 12:51:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/negotiate-authentication-in-custom-python-search-commands/m-p/102110#M21406</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2013-07-31T12:51:53Z</dc:date>
    </item>
  </channel>
</rss>

