<?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: problem with python splunk-sdk autologin in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151020#M2080</link>
    <description>&lt;P&gt;I thought you'd like to know I pushed the splunk-sdk-1.2.2 release to GitHub. This release includes two things: the fix to the bug you found and a new acceptance test to cover your scenario. You can download splunk-sdk-pypthon-1.2.2 from GitHub at &lt;A href="https://github.com/splunk/splunk-sdk-python"&gt;https://github.com/splunk/splunk-sdk-python&lt;/A&gt; right now. Our Web publishing team will be posting to &lt;A href="http://dev.splunk.com/view/python-sdk/"&gt;http://dev.splunk.com/view/python-sdk/&lt;/A&gt; soon.&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
David Noble&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2014 15:08:41 GMT</pubDate>
    <dc:creator>David_Noble_at_</dc:creator>
    <dc:date>2014-02-24T15:08:41Z</dc:date>
    <item>
      <title>problem with python splunk-sdk autologin</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151017#M2077</link>
      <description>&lt;P&gt;Logging in using autologin=True in python splunk-sdk and executing a query gives ResponseReader object as expected if the session is not terminated,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; import splunklib.client as splunkclient
&amp;gt;&amp;gt;&amp;gt; splunk_service = splunkclient.connect(host='searchhead.com', port=8089, username='admin', password='password', autologin=True)
&amp;gt;&amp;gt;&amp;gt; splunk_service.jobs.oneshot("search index=myindex", earliest_time='-1hour')
&amp;lt;splunklib.binding.ResponseReader object at 0xaa2a10&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To terminate the session restarted the splunk search head service in searchhead.com, it restarted splunkd, splunkweb, etc.. tried the following after splunk related services are started.&lt;/P&gt;

&lt;P&gt;Cross checked ports are connected and ready. But the query execution fails with some internal error?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; splunk_service.jobs.oneshot("search index=myindex", earliest_time='-1hour')
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "/usr/lib/python2.6/site-packages/splunklib/client.py", line 2799, in oneshot
    **params).body
  File "/usr/lib/python2.6/site-packages/splunklib/client.py", line 743, in post
    **query)
  File "/usr/lib/python2.6/site-packages/splunklib/binding.py", line 248, in wrapper
    return request_fun()
  File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python2.6/site-packages/splunklib/binding.py", line 180, in _handle_auth_error
    yield
  File "/usr/lib/python2.6/site-packages/splunklib/binding.py", line 248, in wrapper
    return request_fun()
  File "/usr/lib/python2.6/site-packages/splunklib/binding.py", line 61, in new_f
    val = f(*args, **kwargs)
TypeError: post() takes at least 2 arguments (0 given)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But trying again immediately succeeds, (able to reproduce, first try after restart of splunk service always fails and second succeeds):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; splunk_service.jobs.oneshot("search index=myindex", earliest_time='-1hour')
&amp;lt;splunklib.binding.ResponseReader object at 0xaa2e50&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it a known issue? quick googling doesn't help much. Any help towards resolving this issue much appreciated.&lt;/P&gt;

&lt;P&gt;PS: Splunk 6, tried in both splunk-sdk 1.2.0 and 1.0.0&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 13:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151017#M2077</guid>
      <dc:creator>sathiyamoorthy</dc:creator>
      <dc:date>2014-02-14T13:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem with python splunk-sdk autologin</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151018#M2078</link>
      <description>&lt;P&gt;Thanks for reporting this issue. It is a bug and I have a fix in hand. We will include it in the next Python SDK release. &lt;/P&gt;

&lt;P&gt;Here's what you need to do to make the change yourself. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Get the current Python SDK: version 1.2.1&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;At splunklib/binding.py, line 248 change:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            return request_fun()
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            return request_fun(self, *args, **kwargs)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Feel free to e-mail me directly, if you'd like additional help resolving this issue.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Thanks for using Splunk and the Splunk SDK&lt;/P&gt;

&lt;P&gt;Best,&lt;/P&gt;

&lt;P&gt;David Noble&lt;/P&gt;

&lt;P&gt;&lt;A href="mailto:dnoble@splunk.com"&gt;dnoble@splunk.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 19:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151018#M2078</guid>
      <dc:creator>David_Noble_at_</dc:creator>
      <dc:date>2014-02-14T19:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: problem with python splunk-sdk autologin</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151019#M2079</link>
      <description>&lt;P&gt;Thanks, that fixed the issue.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2014 10:14:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151019#M2079</guid>
      <dc:creator>sathiyamoorthy</dc:creator>
      <dc:date>2014-02-17T10:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem with python splunk-sdk autologin</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151020#M2080</link>
      <description>&lt;P&gt;I thought you'd like to know I pushed the splunk-sdk-1.2.2 release to GitHub. This release includes two things: the fix to the bug you found and a new acceptance test to cover your scenario. You can download splunk-sdk-pypthon-1.2.2 from GitHub at &lt;A href="https://github.com/splunk/splunk-sdk-python"&gt;https://github.com/splunk/splunk-sdk-python&lt;/A&gt; right now. Our Web publishing team will be posting to &lt;A href="http://dev.splunk.com/view/python-sdk/"&gt;http://dev.splunk.com/view/python-sdk/&lt;/A&gt; soon.&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
David Noble&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2014 15:08:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151020#M2080</guid>
      <dc:creator>David_Noble_at_</dc:creator>
      <dc:date>2014-02-24T15:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with python splunk-sdk autologin</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151021#M2081</link>
      <description>&lt;P&gt;Just to follow up, the official release on &lt;A href="http://dev.splunk.com/view/python-sdk/"&gt;http://dev.splunk.com/view/python-sdk/&lt;/A&gt; that contains this fix is now live.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 23:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151021#M2081</guid>
      <dc:creator>abrown_splunk</dc:creator>
      <dc:date>2014-03-03T23:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem with python splunk-sdk autologin</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151022#M2082</link>
      <description>&lt;P&gt;Just to follow up, the official release on &lt;A href="http://dev.splunk.com/view/python-sdk/"&gt;http://dev.splunk.com/view/python-sdk/&lt;/A&gt; that contains this fix is now live.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 23:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/problem-with-python-splunk-sdk-autologin/m-p/151022#M2082</guid>
      <dc:creator>abrown_splunk</dc:creator>
      <dc:date>2014-03-03T23:26:34Z</dc:date>
    </item>
  </channel>
</rss>

