<?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 returns Bad Request - what is wrong with my event? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227331#M44333</link>
    <description>&lt;P&gt;While posting a request to Splunk via HEC, I get the response as &lt;CODE&gt;{"text":"No data","code":5}&lt;/CODE&gt; and when I enable version on the curl http request, I get a 400 Bad Request , what is wrong with my event?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -v &lt;A href="https://my-domain:8088/services/collector/event" target="test_blank"&gt;https://my-domain:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk E671602E-0E02-40ED-AADB-FE674F338CF6" -d '{"host”:”some host”,”index":"testing","sourcetype”:”email”,”time":"2016/11/11 22:26:50","source”:”project_eagle”,”event":"{\"subscribed_source\":\"WEB\",\"subscribed_flag\":\"Y\",\"email_type\":\"CUSTOMER\",\"last_name\”:\”Raj\”,\”email_subtype\":\"SUBSCRIBER\",\"email_address\":null,\"product_id\”:\”100\”,\”templateVersion\":null,\"first_name\":\"MARGUERITE\",\"last_sub_change_datetime\":\"2016/11/11 22:26:50\"}"}'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 12 Nov 2016 04:50:09 GMT</pubDate>
    <dc:creator>jagadeeshm</dc:creator>
    <dc:date>2016-11-12T04:50:09Z</dc:date>
    <item>
      <title>HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227331#M44333</link>
      <description>&lt;P&gt;While posting a request to Splunk via HEC, I get the response as &lt;CODE&gt;{"text":"No data","code":5}&lt;/CODE&gt; and when I enable version on the curl http request, I get a 400 Bad Request , what is wrong with my event?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -v &lt;A href="https://my-domain:8088/services/collector/event" target="test_blank"&gt;https://my-domain:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk E671602E-0E02-40ED-AADB-FE674F338CF6" -d '{"host”:”some host”,”index":"testing","sourcetype”:”email”,”time":"2016/11/11 22:26:50","source”:”project_eagle”,”event":"{\"subscribed_source\":\"WEB\",\"subscribed_flag\":\"Y\",\"email_type\":\"CUSTOMER\",\"last_name\”:\”Raj\”,\”email_subtype\":\"SUBSCRIBER\",\"email_address\":null,\"product_id\”:\”100\”,\”templateVersion\":null,\"first_name\":\"MARGUERITE\",\"last_sub_change_datetime\":\"2016/11/11 22:26:50\"}"}'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Nov 2016 04:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227331#M44333</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2016-11-12T04:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227332#M44334</link>
      <description>&lt;P&gt;You have "magic quotes" / "slanted quotes" in there.  Convert everything to straight quotes and it should work.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 16:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227332#M44334</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-12T16:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227333#M44335</link>
      <description>&lt;P&gt;I figured the issue seems to be with date/time format used in "time" field.&lt;/P&gt;

&lt;P&gt;As per - &lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE6P"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAE6P&lt;/A&gt; default time format is long millisecond from epoch. Removing the component, helped me send the events to splunk. &lt;/P&gt;

&lt;P&gt;I am wondering what are the other supported formats along with long milliseconds ?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 03:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227333#M44335</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2016-11-13T03:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227334#M44336</link>
      <description>&lt;P&gt;Not sure, why this was moved to a comment section, my issues is resolved, with my own answer (at least for now), and outline answer has nothing to do with it. Please move it back to its won answer, so I can mark it complete. Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 13:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227334#M44336</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2016-11-13T13:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227335#M44337</link>
      <description>&lt;P&gt;Did you test with straight quotes?&lt;/P&gt;

&lt;P&gt;"product_id\”&lt;/P&gt;

&lt;P&gt;The above won't work because the quotes on left don't match the quotes on right.&lt;/P&gt;

&lt;P&gt;" does not equal ”&lt;/P&gt;

&lt;P&gt;Time shouldn't matter.  Splunk will recognize all sorts of timestamps out of the box.  Especially the one you have mentioned.  However it should be at the beginning of your event unless you're setting a large MAX_TIMESTAMP_LOOKAHEAD on your sourcetype.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:48:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227335#M44337</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T11:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227336#M44338</link>
      <description>&lt;P&gt;I did check on the quotes, and that doesn't seem to be the issue. My event itself doesn't have a time stamp, and setting it into the protocol with time attributes in the json. I don't think sequence of where that time field is appearing is causing issues..because I have several sourcetype that follow the same convention. And they all do work. Only difference I could spot so far is just the difference in time/date format.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 13:33:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227336#M44338</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2016-11-13T13:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227337#M44339</link>
      <description>&lt;P&gt;So can you paste your new event that fails but has the corrected quotes?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 14:05:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227337#M44339</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-13T14:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227338#M44340</link>
      <description>&lt;P&gt;My apologies, I thought this was a comment.  i still don't understand what you did. Did you remove the timestamp from the events?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 14:25:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227338#M44340</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-13T14:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227339#M44341</link>
      <description>&lt;P&gt;Removing timestamp worked for me , but why splunk does not accept its default time format is really something some has to find:&lt;/P&gt;

&lt;P&gt;this what it says about time:&lt;/P&gt;

&lt;P&gt;"time"  The event time. The default time format is epoch time format, in the format &lt;SEC&gt;.&lt;MS&gt;. For example, 1433188255.500 indicates 1433188255 seconds and 500 milliseconds after epoch, or Monday, June 1, 2015, at 7:50:55 PM GMT.&lt;/MS&gt;&lt;/SEC&gt;&lt;/P&gt;

&lt;P&gt;it should have worked, but why it does not work?, Is it worth using SplunkCloud support for programming questions?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2016 16:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227339#M44341</guid>
      <dc:creator>maqsoodbhatti</dc:creator>
      <dc:date>2016-12-03T16:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227340#M44342</link>
      <description>&lt;P&gt;So can you paste your new event that has the corrected quotes?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2016 19:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227340#M44342</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-12-03T19:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227341#M44343</link>
      <description>&lt;P&gt;My problem was I had enabled SSL.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 17:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227341#M44343</guid>
      <dc:creator>VSIRIS</dc:creator>
      <dc:date>2019-10-21T17:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event Collector returns Bad Request - what is wrong with my event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227342#M44344</link>
      <description>&lt;P&gt;This error 5 means "no data". Therefore 400 is returned. Payload has been rejected.&lt;/P&gt;

&lt;P&gt;Watch out for invalid quotes. Test your json with an online syntax checker.&lt;/P&gt;

&lt;P&gt;eg. Mix of quote types ("”). That is, regular " open quote but irregular 99 closure quote.&lt;BR /&gt;
eg. Extra quotes. The third " below appears problematic.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"event":
"{
    "subscribed_source":"WEB",
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/199197"&gt;@jkat54&lt;/a&gt; asked for the payload with CORRECTED quotes:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
    "host":"some host",&lt;BR /&gt;
    "index": "testing",&lt;BR /&gt;
    "sourcetype":"email",&lt;BR /&gt;
    "time": "2016/11/11 22:26:50",&lt;BR /&gt;
    "source":"project_eagle",&lt;BR /&gt;
    "event":&lt;BR /&gt;
    {&lt;BR /&gt;
        "subscribed_source":"WEB",&lt;BR /&gt;
        "subscribed_flag":"Y",&lt;BR /&gt;
        "email_type":"CUSTOMER",&lt;BR /&gt;
        "last_name":"Raj",&lt;BR /&gt;
        "email_subtype":"SUBSCRIBER",&lt;BR /&gt;
        "email_address":null,&lt;BR /&gt;
        "product_id":"100",&lt;BR /&gt;
        "templateVersion":null,&lt;BR /&gt;
        "first_name":"MARGUERITE",&lt;BR /&gt;
        "last_sub_change_datetime":"2016/11/11 22:26:50"&lt;BR /&gt;
    }&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-Collector-returns-Bad-Request-what-is-wrong-with-my/m-p/227342#M44344</guid>
      <dc:creator>shandr</dc:creator>
      <dc:date>2020-09-30T03:57:04Z</dc:date>
    </item>
  </channel>
</rss>

