<?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: How to log in to Splunk using the Splunk Python SDK? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150698#M2070</link>
    <description>&lt;P&gt;To do other items .. have a look into you splunklib.Cline.py's Service class&lt;/P&gt;</description>
    <pubDate>Fri, 17 Apr 2015 10:05:10 GMT</pubDate>
    <dc:creator>paramagurukarth</dc:creator>
    <dc:date>2015-04-17T10:05:10Z</dc:date>
    <item>
      <title>How to log in to Splunk using the Splunk Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150695#M2067</link>
      <description>&lt;P&gt;I am trying to log in and search users from a windows machine on Splunk server using Splunk python SDK over HTTP, but getting some errors.  Please find Logs below ( HTTP Request / Response ) .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;c:\Users\vgupta13\Downloads\splunk-sdk-python-master\examples&amp;gt;C:\Python27\python.exe search.py "search vgupta13 " --output_mode=csv --verbose=verbose
{'body': 'username=vgupta13&amp;amp;password=*******', 'headers': [('Content-Type', 'application/x-www-form-urlencoded')], 'method': 'POST'}

send: 'POST /services/auth/login HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 35\r\nContent-Type: application/x-www-form-urlencoded\r\nHost: ficcspl
unk\r\nAccept: */*\r\nUser-Agent: splunk-sdk-python/0.1\r\n\r\nusername=vgupta13&amp;amp;password=*******'
Get the response from the server.
HTTPResponse init
------------------begin
reply: 'HTTP/1.1 303 See Other\r\n'
header: Server: CherryPy/3.1.2
header: Location: &lt;A href="http://splunkserver/en-US/services/auth/login" target="test_blank"&gt;http://splunkserver/en-US/services/auth/login&lt;/A&gt;
header: Content-Type: text/html;charset=utf-8
header: Content-Length: 132
header: Date: Mon, 13 Apr 2015 12:02:52 GMT
header: Set-Cookie: session_id_8000=4f0020a7bf9fe5c60abcddbdf6a6e037a4a3d35a; expires=Tue, 21 Apr 2015 12:02:52 GMT; httponly; Path=/




send: 'GET /servicesNS/nobody/alert/search/parser?q=search+vgupta13+&amp;amp;parse_only=True HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 0\r\nHost: ficcspl
unk\r\nAccept: */*\r\nUser-Agent: splunk-sdk-python/0.1\r\n\r\n'
***Get the response from the server.***
HTTPResponse init
------------------begin
reply: 'HTTP/1.1 303 See Other\r\n'
header: Server: CherryPy/3.1.2
header: Location: &lt;A href="http://splunkserver/en-US/servicesNS/nobody/alert/search/parser?q=search+vgupta13+&amp;amp;parse_only=True" target="test_blank"&gt;http://splunkserver/en-US/servicesNS/nobody/alert/search/parser?q=search+vgupta13+&amp;amp;parse_only=True&lt;/A&gt;
header: Content-Type: text/html;charset=utf-8
header: Content-Length: 246
header: Date: Mon, 13 Apr 2015 12:02:52 GMT
header: Set-Cookie: session_id_8000=79ff553379c53a3dac1846f27c065d3561cd3f3c; expires=Tue, 21 Apr 2015 12:02:52 GMT; httponly; Path=/


{'body': 'search=search+vgupta13+', 'headers': [('Content-Type', 'application/x-www-form-urlencoded')], 'method': 'POST'}

send: 'POST /servicesNS/nobody/alert/search/jobs/ HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 23\r\nContent-Type: application/x-www-form-urlencoded
\r\nHost: splunkserver\r\nAccept: */*\r\nUser-Agent: splunk-sdk-python/0.1\r\n\r\nsearch=search+vgupta13+'
Get the response from the server.
HTTPResponse init
------------------begin
reply: 'HTTP/1.1 303 See Other\r\n'
header: Server: CherryPy/3.1.2
header: Location: &lt;A href="http://splunkserver/en-US/servicesNS/nobody/alert/search/jobs" target="test_blank"&gt;http://splunkserver/en-US/servicesNS/nobody/alert/search/jobs&lt;/A&gt;
header: Content-Type: text/html;charset=utf-8
header: Content-Length: 164
header: Date: Mon, 13 Apr 2015 12:02:53 GMT
header: Set-Cookie: session_id_8000=d67ebfa9d64e26c2be64a6943b6d93abc5839d5e; expires=Tue, 21 Apr 2015 12:02:53 GMT; httponly; Path=/


self.fp
Traceback (most recent call last):
  File "search.py", line 115, in 
    main(sys.argv[1:])
  File "search.py", line 80, in main
    job = service.jobs.create(search, **kwargs_create)
  File "..\splunklib\client.py", line 2882, in create
    sid = _load_sid(response)
  File "..\splunklib\client.py", line 221, in _load_sid
    return _load_atom(response).response.sid
AttributeError: 'NoneType' object has no attribute 'response'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Apr 2015 05:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150695#M2067</guid>
      <dc:creator>reachvgupta</dc:creator>
      <dc:date>2015-04-17T05:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to log in to Splunk using the Splunk Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150696#M2068</link>
      <description>&lt;P&gt;I am stuck , can someone please have a look&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 09:06:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150696#M2068</guid>
      <dc:creator>reachvgupta</dc:creator>
      <dc:date>2015-04-17T09:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to log in to Splunk using the Splunk Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150697#M2069</link>
      <description>&lt;P&gt;Please try the below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; import splunklib.client as client

    class RestController():
        HOST = "localhose"
        PORT = 8089
        USERNAME = "userName"
        PASSWORD = "password"

        currentUser =""


        def getService(self):        
            return client.connect(host=self.HOST,port=self.PORT,username=self.USERNAME,password=self.PASSWORD)


    mani = RestController()
    service = mani.getService()
    users = service.users
    for user in users:
        print user.name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Apr 2015 10:03:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150697#M2069</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2015-04-17T10:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to log in to Splunk using the Splunk Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150698#M2070</link>
      <description>&lt;P&gt;To do other items .. have a look into you splunklib.Cline.py's Service class&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 10:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150698#M2070</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2015-04-17T10:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to log in to Splunk using the Splunk Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150699#M2071</link>
      <description>&lt;P&gt;Its giving me same Error.... as Above &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2015 06:12:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150699#M2071</guid>
      <dc:creator>reachvgupta</dc:creator>
      <dc:date>2015-04-30T06:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to log in to Splunk using the Splunk Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150700#M2072</link>
      <description>&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;
  File "testlogin.py", line 15, in &lt;BR /&gt;
    for user in users:&lt;BR /&gt;
  File "C:\Python27\lib\site-packages\splunklib\client.py", line 1218, in &lt;STRONG&gt;iter&lt;/STRONG&gt;&lt;BR /&gt;
    for item in self.iter(**kwargs):&lt;BR /&gt;
  File "C:\Python27\lib\site-packages\splunklib\client.py", line 1382, in iter&lt;BR /&gt;
    items = self._load_list(response)&lt;BR /&gt;
  File "C:\Python27\lib\site-packages\splunklib\client.py", line 1288, in _load_list&lt;BR /&gt;
    entries = _load_atom_entries(response)&lt;BR /&gt;
  File "C:\Python27\lib\site-packages\splunklib\client.py", line 202, in _load_atom_entries&lt;BR /&gt;
    if 'feed' in r:&lt;BR /&gt;
TypeError: argument of type 'NoneType' is not iterable&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-log-in-to-Splunk-using-the-Splunk-Python-SDK/m-p/150700#M2072</guid>
      <dc:creator>reachvgupta</dc:creator>
      <dc:date>2020-09-28T19:43:10Z</dc:date>
    </item>
  </channel>
</rss>

