<?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: HTTP event collector -- error with data format? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352758#M64641</link>
    <description>&lt;P&gt;Need to add sourcetype in your event like {"event":"testing", "sourcetype": "st"}&lt;/P&gt;</description>
    <pubDate>Thu, 06 Sep 2018 17:08:15 GMT</pubDate>
    <dc:creator>chli_splunk</dc:creator>
    <dc:date>2018-09-06T17:08:15Z</dc:date>
    <item>
      <title>HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352755#M64638</link>
      <description>&lt;P&gt;I want to try to inputting a simple event to HTTP event collector just to test if it works. I think it was able to find the web address and also authenticate it with the token value. But I get an error with the invalid data format. What can I do to fix it?&lt;BR /&gt;
I have the following command:&lt;BR /&gt;
curl -k -H "Authorization: Splunk B86C5445-76D4-4FAF-A0FA-D8FE2FA49F79" &lt;A href="https://localhost:8088/services/collector/event"&gt;https://localhost:8088/services/collector/event&lt;/A&gt; -d '{"event":"testing"}'&lt;BR /&gt;
With the following result:&lt;BR /&gt;
{"text":"Invalid data format","code":6,"invalid-event-number":0}&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 21:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352755#M64638</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-09-20T21:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352756#M64639</link>
      <description>&lt;P&gt;Why the duplicate post? You already had a thread going... Anyways, try escaping the double quotes (curl may not like it the way it is):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -H "Authorization: Splunk B86C5445-76D4-4FAF-A0FA-D8FE2FA49F79" &lt;A href="https://localhost:8088/services/collector/event" target="test_blank"&gt;https://localhost:8088/services/collector/event&lt;/A&gt; -d '{\"event\":\"testing\"}'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Sep 2017 01:51:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352756#M64639</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-09-21T01:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352757#M64640</link>
      <description>&lt;P&gt;I still have the same error &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 14:15:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352757#M64640</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-09-21T14:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352758#M64641</link>
      <description>&lt;P&gt;Need to add sourcetype in your event like {"event":"testing", "sourcetype": "st"}&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 17:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352758#M64641</guid>
      <dc:creator>chli_splunk</dc:creator>
      <dc:date>2018-09-06T17:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352759#M64642</link>
      <description>&lt;P&gt;For the record, this one worked for us -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl "https://&amp;lt;HEC service&amp;gt;:443/services/collector/event" -H "Authorization: Splunk f5b9eac2-7319-4dfb-80d0-86f44a9785cd" -k -d "{\"host\":\"xxxx\",\"sourcetype\":\"test_hec\",\"source\":\"test\",\"event\":{\"message\":\"ERROR\",\"code\":\"401\"}}"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 May 2019 20:27:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352759#M64642</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-05-31T20:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352760#M64643</link>
      <description>&lt;P&gt;I know this is an old post, but it seems that there isn't a good answer to this question, so I felt I should share after recently experiencing the same error. &lt;BR /&gt;
The error is in my experience is indicative of a formatting issue or expected key / value pairs that are missing in or with your data.  I would inspect the data for unexpected characters, white space's, etc as well.  An example: I ran into this issue, and when inspecting the format of the data there were white spaces between colons that separate k/v pairs:&lt;/P&gt;

&lt;P&gt;Example of data where I saw this error.  Although not apparent, there are white spaces between the key: value.  When I removed the white spaces, I was able to successfully send the data:&lt;BR /&gt;
(NOTE: This is metric data going to a metric index).&lt;/P&gt;

&lt;P&gt;"{&lt;BR /&gt;
    "source": "t_e_api", &lt;BR /&gt;
    "host": "server1, &lt;BR /&gt;
    "event": "metric", &lt;BR /&gt;
    "fields": &lt;BR /&gt;
    {&lt;BR /&gt;
        "ftpTimeLimit": "1", &lt;BR /&gt;
        "group": "", &lt;BR /&gt;
        "metric_name": "c_u_used",&lt;BR /&gt;
        "agents": "",&lt;BR /&gt;
        "accountGroupName": "Is1",&lt;BR /&gt;
        "url": "",&lt;BR /&gt;
        "type": "1",&lt;BR /&gt;
        "interval":"4",&lt;BR /&gt;
        "enabled":"1",&lt;BR /&gt;
        "testName": "test1",&lt;BR /&gt;
        "_value": 3022222,&lt;BR /&gt;
        "sipTimeLimit": "1",&lt;BR /&gt;
        "httpTimeLimit": "3",&lt;BR /&gt;
        "aid": 170000,&lt;BR /&gt;
        "pageLoadTimeLimit": "7",&lt;BR /&gt;
        "test_id": 110101,&lt;BR /&gt;
        "testType": "Web - HTTP Server"&lt;BR /&gt;
    },&lt;BR /&gt;
    "time": 1571420739&lt;BR /&gt;
}"&lt;/P&gt;

&lt;P&gt;This adjustment (removal of white spaces) fixed the issue:&lt;BR /&gt;
"{&lt;BR /&gt;
    "source":"t_e_api", &lt;BR /&gt;
    "host":"server1, &lt;BR /&gt;
    "event":"metric", &lt;BR /&gt;
    "fields":&lt;BR /&gt;
    {&lt;BR /&gt;
        "ftpTimeLimit":"1", &lt;BR /&gt;
        "group":"", &lt;BR /&gt;
        "metric_name":"c_u_used",&lt;BR /&gt;
        "agents":"",&lt;BR /&gt;
        "accountGroupName":"Is1",&lt;BR /&gt;
        "url":"",&lt;BR /&gt;
        "type":"1",&lt;BR /&gt;
        "interval":"4",&lt;BR /&gt;
        "enabled":"1",&lt;BR /&gt;
        "testName":"test1",&lt;BR /&gt;
        "_value":3022222,&lt;BR /&gt;
        "sipTimeLimit":"1",&lt;BR /&gt;
        "httpTimeLimit":"3",&lt;BR /&gt;
        "aid":170000,&lt;BR /&gt;
        "pageLoadTimeLimit":"7",&lt;BR /&gt;
        "test_id":110101,&lt;BR /&gt;
        "testType":"Web - HTTP Server"&lt;BR /&gt;
    },&lt;BR /&gt;
    "time":1571420739&lt;BR /&gt;
}"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:34:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352760#M64643</guid>
      <dc:creator>damiensurat</dc:creator>
      <dc:date>2020-09-30T02:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352761#M64644</link>
      <description>&lt;P&gt;Just replace event by raw like this:&lt;BR /&gt;
curl -k &lt;A href="https://localhost:8088/services/collector/raw"&gt;https://localhost:8088/services/collector/raw&lt;/A&gt; -H "Authorization: Splunk 65652e8c-443d-42b6-9b75-02657b215665" -d '{"event":"This is test http event collector"}'&lt;BR /&gt;
You can find the answer from this link:&lt;BR /&gt;
&lt;A href="https://medium.com/adarma-tech-blog/splunk-http-event-collectors-explained-2c22e87ab8d2,Just"&gt;https://medium.com/adarma-tech-blog/splunk-http-event-collectors-explained-2c22e87ab8d2,Just&lt;/A&gt; replace event by raw like this:&lt;BR /&gt;
curl -k &lt;A href="https://localhost:8088/services/collector/raw"&gt;https://localhost:8088/services/collector/raw&lt;/A&gt; -H "Authorization: Splunk 65652e8c-443d-42b6-9b75-02657b215665" -d '{"event":"This is test http event collector"}'&lt;BR /&gt;
I found this answer from following link: &lt;BR /&gt;
&lt;A href="https://medium.com/adarma-tech-blog/splunk-http-event-collectors-explained-2c22e87ab8d2"&gt;https://medium.com/adarma-tech-blog/splunk-http-event-collectors-explained-2c22e87ab8d2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 04:10:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/352761#M64644</guid>
      <dc:creator>anupagazi</dc:creator>
      <dc:date>2020-04-10T04:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector -- error with data format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/678754#M113421</link>
      <description>&lt;P&gt;Was getting similar errors too. Adding the /raw in my curl statement resolved the issue.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 02:51:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/m-p/678754#M113421</guid>
      <dc:creator>NKB</dc:creator>
      <dc:date>2024-02-27T02:51:42Z</dc:date>
    </item>
  </channel>
</rss>

