<?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 Not able to push data to splunk using python SDK in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-push-data-to-splunk-using-python-SDK/m-p/378297#M95406</link>
    <description>&lt;P&gt;I am using below code to push data to splunk using Python SDk,script is executed successfully but i am not seeing any data in splunk.&lt;/P&gt;

&lt;P&gt;import splunklib.client as client&lt;BR /&gt;
service = client.connect(host='localhost',port=8089,username='username',password='password')&lt;BR /&gt;
myindex = service.indexes["main"]&lt;BR /&gt;
mysocket = myindex.attach(sourcetype='rajanish',host='myhost')&lt;BR /&gt;
file_data = ''&lt;BR /&gt;
with open("foo.txt", "r") as lines:&lt;BR /&gt;
    for line in lines:&lt;BR /&gt;
        if line.isspace():&lt;BR /&gt;
            line = ' '&lt;BR /&gt;
            file_data += line&lt;BR /&gt;
            file_data += '\r\n'&lt;BR /&gt;
            mysocket.send(file_data)&lt;BR /&gt;
            mysocket.close()&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:51:14 GMT</pubDate>
    <dc:creator>rajanishsinght</dc:creator>
    <dc:date>2020-09-29T23:51:14Z</dc:date>
    <item>
      <title>Not able to push data to splunk using python SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-push-data-to-splunk-using-python-SDK/m-p/378297#M95406</link>
      <description>&lt;P&gt;I am using below code to push data to splunk using Python SDk,script is executed successfully but i am not seeing any data in splunk.&lt;/P&gt;

&lt;P&gt;import splunklib.client as client&lt;BR /&gt;
service = client.connect(host='localhost',port=8089,username='username',password='password')&lt;BR /&gt;
myindex = service.indexes["main"]&lt;BR /&gt;
mysocket = myindex.attach(sourcetype='rajanish',host='myhost')&lt;BR /&gt;
file_data = ''&lt;BR /&gt;
with open("foo.txt", "r") as lines:&lt;BR /&gt;
    for line in lines:&lt;BR /&gt;
        if line.isspace():&lt;BR /&gt;
            line = ' '&lt;BR /&gt;
            file_data += line&lt;BR /&gt;
            file_data += '\r\n'&lt;BR /&gt;
            mysocket.send(file_data)&lt;BR /&gt;
            mysocket.close()&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-push-data-to-splunk-using-python-SDK/m-p/378297#M95406</guid>
      <dc:creator>rajanishsinght</dc:creator>
      <dc:date>2020-09-29T23:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to push data to splunk using python SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-push-data-to-splunk-using-python-SDK/m-p/378298#M95407</link>
      <description>&lt;P&gt;hi rajanish,&lt;/P&gt;

&lt;P&gt;did you get this issue fixed. can you help me with the python code. i am also trying to push data to splunk.&lt;/P&gt;

&lt;P&gt;I am new to splunk, so kindly help me&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 09:05:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-push-data-to-splunk-using-python-SDK/m-p/378298#M95407</guid>
      <dc:creator>yaseenbe</dc:creator>
      <dc:date>2020-03-05T09:05:53Z</dc:date>
    </item>
  </channel>
</rss>

