<?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: Inserting new events via the REST API using the Receivers endpoints thru Java SDK in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91755#M19070</link>
    <description>&lt;P&gt;The Java SDK introduces a Receivers class in the SDK refresh due at beginning of June. It shows how to submit events very easily.&lt;/P&gt;</description>
    <pubDate>Thu, 03 May 2012 23:15:04 GMT</pubDate>
    <dc:creator>wcolgate_splunk</dc:creator>
    <dc:date>2012-05-03T23:15:04Z</dc:date>
    <item>
      <title>Inserting new events via the REST API using the Receivers endpoints thru Java SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91750#M19065</link>
      <description>&lt;P&gt;I'm doing Java Splunk REST API to insert new events via the REST API.&lt;/P&gt;

&lt;P&gt;I used the Java's splunk service api to add headers and put in the path for the &lt;BR /&gt;
receiver end point&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Map&amp;lt;string, object=""&amp;gt; args = new HashMap&amp;lt;string, object=""&amp;gt;();

args.put("Authorization", "Basic YWRtaW46cGFzcw==");

args.put("x-splunk-input-mode", "streaming");

String path = "https://localhost:8089/services/receivers/stream?data="+data+"&amp;amp;host="+host+"&amp;amp;index="+index+"&amp;amp;source="+source+"&amp;amp;sourcetype="+sourcetype;
authService.post(path,args);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A &lt;CODE&gt;HTTP 404 error&lt;/CODE&gt; was thrown when i run the code. The receiver wasn't present. Probably due to the HttpHeaders. &lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2012 09:03:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91750#M19065</guid>
      <dc:creator>misteryuku</dc:creator>
      <dc:date>2012-03-14T09:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting new events via the REST API using the Receivers endpoints thru Java SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91751#M19066</link>
      <description>&lt;P&gt;I changed and i tried this : &lt;BR /&gt;
RequestMessage reqMsg = new RequestMessage();&lt;BR /&gt;
reqMsg.setMethod("POST");   reqMsg.getHeader().put("Authorization" , authService.getToken());&lt;BR /&gt;
reqMsg.getHeader().put("x-splunk-input-mode", "streaming");&lt;BR /&gt;
            String path = "&lt;A href="https://localhost:8089/services/receivers/stream?data=%22+data+%22?host=%22+host+%22&amp;amp;index=%22+index+%22&amp;amp;source=%22+source+%22&amp;amp;sourcetype=%22+sourcetype"&gt;https://localhost:8089/services/receivers/stream?data="+data+"?host="+host+"&amp;amp;index="+index+"&amp;amp;source="+source+"&amp;amp;sourcetype="+sourcetype&lt;/A&gt;;&lt;BR /&gt;
authService.send(path,reqMsg);&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2012 09:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91751#M19066</guid>
      <dc:creator>misteryuku</dc:creator>
      <dc:date>2012-03-14T09:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting new events via the REST API using the Receivers endpoints thru Java SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91752#M19067</link>
      <description>&lt;P&gt;Is it really the authService object you should be sending this request via?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2012 09:55:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91752#M19067</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-03-14T09:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting new events via the REST API using the Receivers endpoints thru Java SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91753#M19068</link>
      <description>&lt;P&gt;Not sure sure if this is useful but if you look at index.java in the Java SDK, at the end it provides a way to upload data to a named index.  &lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2012 11:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91753#M19068</guid>
      <dc:creator>MarioM</dc:creator>
      <dc:date>2012-03-14T11:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting new events via the REST API using the Receivers endpoints thru Java SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91754#M19069</link>
      <description>&lt;P&gt;Yes!! Absolutely&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2012 12:24:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91754#M19069</guid>
      <dc:creator>misteryuku</dc:creator>
      <dc:date>2012-03-14T12:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting new events via the REST API using the Receivers endpoints thru Java SDK</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91755#M19070</link>
      <description>&lt;P&gt;The Java SDK introduces a Receivers class in the SDK refresh due at beginning of June. It shows how to submit events very easily.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2012 23:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Inserting-new-events-via-the-REST-API-using-the-Receivers/m-p/91755#M19070</guid>
      <dc:creator>wcolgate_splunk</dc:creator>
      <dc:date>2012-05-03T23:15:04Z</dc:date>
    </item>
  </channel>
</rss>

