<?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: Verify Splunk operation using Python SDK in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354839#M5679</link>
    <description>&lt;P&gt;Are you on CentOS or RHEL 7?&lt;/P&gt;</description>
    <pubDate>Sat, 03 Feb 2018 03:29:48 GMT</pubDate>
    <dc:creator>micahkemp</dc:creator>
    <dc:date>2018-02-03T03:29:48Z</dc:date>
    <item>
      <title>Verify Splunk operation using Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354836#M5676</link>
      <description>&lt;P&gt;I am working on a tool to validate that splunk is operational, both HEC and std Indexing (9997). HEC Is easy to do with either python requests or the SDK, but how can I script, in python, writing a test event directly to the indexes on port 9997? I assume that the SDK will be my friend!?!?! Any help is MUCH appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 23:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354836#M5676</guid>
      <dc:creator>brent_weaver</dc:creator>
      <dc:date>2018-02-02T23:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Splunk operation using Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354837#M5677</link>
      <description>&lt;P&gt;I have the following simple code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/usr/bin/env python

import splunklib.client as client

HOST = "localhost"
PORT = 8089
USERNAME = "admin"
PASSWORD = "joniie"

# Create a Service instance and log in
service = client.connect(host=HOST, port=PORT, username=USERNAME, password=PASSWORD)

# Print installed apps to the console to verify login
for app in service.apps:
    print app.name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I run this locally on the SPlunk test host (which has SDK installed) I get the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Traceback (most recent call last):
  File "./logger.py", line 11, in &amp;lt;module&amp;gt;
    service = client.connect(host=HOST, port=PORT, username=USERNAME, password=PASSWORD)
  File "/usr/lib/python2.7/site-packages/splunklib/client.py", line 321, in connect
    s.login()
  File "/usr/lib/python2.7/site-packages/splunklib/binding.py", line 857, in login
    cookie="1") # In Splunk 6.2+, passing "cookie=1" will return the "set-cookie" header
  File "/usr/lib/python2.7/site-packages/splunklib/binding.py", line 1201, in post
    return self.request(url, message)
  File "/usr/lib/python2.7/site-packages/splunklib/binding.py", line 1218, in request
    response = self.handler(url, message, **kwargs)
  File "/usr/lib/python2.7/site-packages/splunklib/binding.py", line 1357, in request
    connection.request(method, path, body, head)
  File "/usr/lib64/python2.7/httplib.py", line 1017, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1051, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.7/httplib.py", line 826, in send
    self.connect()
  File "/usr/lib64/python2.7/httplib.py", line 1236, in connect
    server_hostname=sni_hostname)
  File "/usr/lib64/python2.7/ssl.py", line 350, in wrap_socket
    _context=self)
  File "/usr/lib64/python2.7/ssl.py", line 611, in __init__
    self.do_handshake()
  File "/usr/lib64/python2.7/ssl.py", line 833, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What am I missing? Why is this not working? &lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 23:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354837#M5677</guid>
      <dc:creator>brent_weaver</dc:creator>
      <dc:date>2018-02-02T23:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Splunk operation using Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354838#M5678</link>
      <description>&lt;P&gt;This seems to be related to Splunk 7.x tree and not my 6.5.2 systems. I remember that there is a big change in SSL/TLS from 6 -&amp;gt; 7 so that would make sense. So that being said, does anyone know how to work around this issue so I can use the SDK on 7.x?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 03:18:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354838#M5678</guid>
      <dc:creator>brent_weaver</dc:creator>
      <dc:date>2018-02-03T03:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Splunk operation using Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354839#M5679</link>
      <description>&lt;P&gt;Are you on CentOS or RHEL 7?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 03:29:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354839#M5679</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-03T03:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Splunk operation using Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354840#M5680</link>
      <description>&lt;P&gt;Try this one &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/609126/ssl-error-while-trying-to-connect-to-splunk-web-fr.html#answer-610130"&gt;https://answers.splunk.com/answers/609126/ssl-error-while-trying-to-connect-to-splunk-web-fr.html#answer-610130&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 22:46:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354840#M5680</guid>
      <dc:creator>muralikoppula</dc:creator>
      <dc:date>2018-02-03T22:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Splunk operation using Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354841#M5681</link>
      <description>&lt;P&gt;Thank you VERY much for taking the time to help me out there. This worked&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 12:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Verify-Splunk-operation-using-Python-SDK/m-p/354841#M5681</guid>
      <dc:creator>brent_weaver</dc:creator>
      <dc:date>2018-02-04T12:44:59Z</dc:date>
    </item>
  </channel>
</rss>

