<?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 HTTP Event Collector batch post and HTTP errors in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-batch-post-and-HTTP-errors/m-p/556824#M92146</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've started using HEC to push data to my Splunk Enterprise instance and noticed the errors I get.&lt;/P&gt;&lt;P&gt;For example, sending this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{"aa": "hello world"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "text": "No data",
  "code": 5
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when sending events in batches, I will only get this error if the first event I send is problematic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{"event": "hello world"}
{"aa": "hello world"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "text": "Success",
  "code": 0
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I need to know that all my events were sent successfully (and "acks" are not an option, considering I send data to Splunk Cloud as well), is there anything I can do (other than sending each event by itself)?&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 08:24:33 GMT</pubDate>
    <dc:creator>yotamcp</dc:creator>
    <dc:date>2021-06-23T08:24:33Z</dc:date>
    <item>
      <title>HTTP Event Collector batch post and HTTP errors</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-batch-post-and-HTTP-errors/m-p/556824#M92146</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've started using HEC to push data to my Splunk Enterprise instance and noticed the errors I get.&lt;/P&gt;&lt;P&gt;For example, sending this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{"aa": "hello world"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "text": "No data",
  "code": 5
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when sending events in batches, I will only get this error if the first event I send is problematic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{"event": "hello world"}
{"aa": "hello world"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "text": "Success",
  "code": 0
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I need to know that all my events were sent successfully (and "acks" are not an option, considering I send data to Splunk Cloud as well), is there anything I can do (other than sending each event by itself)?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 08:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-batch-post-and-HTTP-errors/m-p/556824#M92146</guid>
      <dc:creator>yotamcp</dc:creator>
      <dc:date>2021-06-23T08:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector batch post and HTTP errors</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-batch-post-and-HTTP-errors/m-p/556942#M92159</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235473"&gt;@yotamcp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You must be using /services/collector HEC endpoint. event: &amp;lt;your data&amp;gt; is the format when you send data to collector endpoint and only if it is JSON. In your first example there was no event:&amp;lt;&amp;gt; format hence splunk HEC ignored it in second example you have followed the format.&lt;/P&gt;&lt;P&gt;if you wanted to send raw data like any non JSON use /services/raw/ HEC endpoint. You can send multiple events together in a batch. All combination of examples exist here,&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.0/Data/HTTPEventCollectortokenmanagement#Send_an_event_to_HEC" target="_blank"&gt;Use cURL to manage HTTP Event Collector tokens, events, and services - Splunk Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.0/Data/HECExamples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.0/Data/HECExamples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;An upvote would be appreciated and accept solution if it helps!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 07:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-batch-post-and-HTTP-errors/m-p/556942#M92159</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-06-24T07:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector batch post and HTTP errors</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-batch-post-and-HTTP-errors/m-p/557276#M92221</link>
      <description>&lt;P&gt;I understand all that.&lt;/P&gt;&lt;P&gt;What I was trying to explain was that in a batch, I can send data like this, and get a "Success" message:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{ ... correct format ... }
{ ... correct format ... }
{ ... correct format ... }
{ ... inccorrect format ... }
{ ... correct format ... }
{ ... correct format ... }&lt;/LI-CODE&gt;&lt;P&gt;Or I can send data like this and get an error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{ ... inccorrect format ... }
{ ... correct format ... }
{ ... correct format ... }
{ ... correct format ... }
{ ... correct format ... }
{ ... correct format ... }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I wanted to know, is if there is a way to send batch data, and fail the entire bulk on a single incorrect event (atomically).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jun 2021 06:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-batch-post-and-HTTP-errors/m-p/557276#M92221</guid>
      <dc:creator>yotamcp</dc:creator>
      <dc:date>2021-06-27T06:52:27Z</dc:date>
    </item>
  </channel>
</rss>

