<?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 won't work - only http 404 when trying to post in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/557156#M92201</link>
    <description>&lt;P&gt;Thank you for submitting this solution - after a number of hours of searching for the correct format this works for me.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 09:57:37 GMT</pubDate>
    <dc:creator>Borobest</dc:creator>
    <dc:date>2021-06-25T09:57:37Z</dc:date>
    <item>
      <title>HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516368#M87387</link>
      <description>&lt;P&gt;Splunk Enterprise - Windows - 8.0.5&lt;/P&gt;&lt;P&gt;I have tried to enable the HTTP Event Collector following this guideline &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Data/UsetheHTTPEventCollector" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Data/UsetheHTTPEventCollector&lt;/A&gt;&amp;nbsp;- made sure that HEC is enabled and then created a token.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;[http://MyScript]
disabled = 0
index = operations
indexes = operations
token = b68999b2-9f22-4b53-ba6e-0a8cfd505251
useACK = 0
description = HTTP EVent collector for script&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From file&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;D:\Splunk\etc\apps\search\local\inputs.conf&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Server restarted - but still&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k "https://splunkindex:8088/services/collector"
{"text":"The requested URL was not found on this server.","code":404}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So whatever I do trying to post an event - fails&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k "https://splunkindex:8088/services/collector" -H "Authorization: Splunk b68999b2-9f22-4b53-ba6e-0a8cfd505251" -d '{"event": "Hello, world!",  "sourcetype": "manual"}'
{"text":"Invalid data format","code":6,"invalid-event-number":0}curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: sourcetype
curl: (3) unmatched close brace/bracket in URL position 7:
manual}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but at least something is working&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k "https://splunkindex:8088/services/collector/health"
{"text":"HEC is healthy","code":17}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did also try&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rest /services/collector/health&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but that fails - so I have not fully understod the "| rest" command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, ref&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Data/HTTPEventCollectortokenmanagement" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Data/HTTPEventCollectortokenmanagement&lt;/A&gt;&amp;nbsp;it says I can list the existing tokens using command&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k -u admin:password https://splunkindex:8089/servicesNS/admin/splunk_httpinput/data/inputs/http&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot see any refrences to my token in the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml-stylesheet type="text/xml" href="/static/atom.xsl"?&amp;gt;
&amp;lt;feed xmlns="http://www.w3.org/2005/Atom" xmlns:s="http://dev.splunk.com/ns/rest" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"&amp;gt;
  &amp;lt;title&amp;gt;http&amp;lt;/title&amp;gt;
  &amp;lt;id&amp;gt;https://splunkindex:8089/servicesNS/admin/splunk_httpinput/data/inputs/http&amp;lt;/id&amp;gt;
  &amp;lt;updated&amp;gt;2020-08-26T21:40:06+02:00&amp;lt;/updated&amp;gt;
  &amp;lt;generator build="a1a6394cc5ae" version="8.0.5"/&amp;gt;
  &amp;lt;author&amp;gt;
    &amp;lt;name&amp;gt;Splunk&amp;lt;/name&amp;gt;
  &amp;lt;/author&amp;gt;
  &amp;lt;link href="/servicesNS/admin/splunk_httpinput/data/inputs/http/_new" rel="create"/&amp;gt;
  &amp;lt;link href="/servicesNS/admin/splunk_httpinput/data/inputs/http/_reload" rel="_reload"/&amp;gt;
  &amp;lt;link href="/servicesNS/admin/splunk_httpinput/data/inputs/http/_acl" rel="_acl"/&amp;gt;
  &amp;lt;opensearch:totalResults&amp;gt;0&amp;lt;/opensearch:totalResults&amp;gt;
  &amp;lt;opensearch:itemsPerPage&amp;gt;30&amp;lt;/opensearch:itemsPerPage&amp;gt;
  &amp;lt;opensearch:startIndex&amp;gt;0&amp;lt;/opensearch:startIndex&amp;gt;
  &amp;lt;s:messages/&amp;gt;
&amp;lt;/feed&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 19:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516368#M87387</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-08-26T19:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516373#M87388</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;can you post the output of&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;splunk btool inputs list http&lt;/LI-CODE&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 20:02:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516373#M87388</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-26T20:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516375#M87389</link>
      <description>&lt;LI-CODE lang="markup"&gt;D:\Splunk\bin&amp;gt;splunk btool inputs list http
[http]
_rcvbuf = 1572864
ackIdleCleanup = true
allowSslCompression = true
allowSslRenegotiation = true
dedicatedIoThreads = 2
disabled = 0
enableSSL = 1
evt_dc_name =
evt_dns_name =
evt_resolve_ad_obj = 0
host = SplunkIndex
index = operations
maxSockets = 0
maxThreads = 0
port = 8088
sslVersions = *,-ssl2
useDeploymentServer = 0
[http://MyScript]
_rcvbuf = 1572864
description = HTTP EVent collector for script
disabled = 0
evt_dc_name =
evt_dns_name =
evt_resolve_ad_obj = 0
host = SplunkIndex
index = operations
indexes = operations
token = b68999b2-9f22-4b53-ba6e-0a8cfd505251
useACK = 0&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Aug 2020 20:06:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516375#M87389</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-08-26T20:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516380#M87391</link>
      <description>&lt;P&gt;Please try to whole url like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;curl -k  https://hec.splunk.com:8088/services/collector/event -H "Authorization: Splunk B5A89CAD-D842-46CC-80A1-017F83D7CFB2" -d '{"event": "hello world"}'&lt;/LI-CODE&gt;&lt;P&gt;it should contains &amp;nbsp;/event also.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 20:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516380#M87391</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-26T20:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516383#M87392</link>
      <description>&lt;P&gt;Did not help to add /event. If I remove -d it returns the 404. Not really sure what is really wrong since I get three errors. Did try to switch the quotes (single vs double), but that did not help either - so not really sure if the brackets are wrong or if that is just a false positive.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k "https://splunkindex:8088/services/collector" -H "Authorization: Splunk b68999b2-9f22-4b53-ba6e-0a8cfd505251" -d '{"event": "Hello, world!",  "sourcetype": "manual"}'
{"text":"Invalid data format","code":6,"invalid-event-number":0}curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: sourcetype
curl: (3) unmatched close brace/bracket in URL position 7:
manual}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 20:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516383#M87392</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-08-26T20:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516394#M87395</link>
      <description>&lt;P&gt;Please try to remove “ from https... URL should be without those.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 21:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516394#M87395</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-26T21:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516434#M87411</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I just enabled HEC and created new token based on that instructions on my workstation with Splunk 8.0.5. Works w/o issues.&lt;/P&gt;&lt;LI-CODE lang="java"&gt;(0) $ curl -k https://localhost:8088/services/collector/event -H "Authorization: Splunk 9dd3e284-1619-4070-be37-59250cd52876" -d '{"event": "Hello, world!",  "sourcetype": "manual"}'
{"text":"Success","code":0}
(0) $ curl -k "https://localhost:8088/services/collector/event" -H "Authorization: Splunk 9dd3e284-1619-4070-be37-59250cd52876" -d '{"event": "Hello, world!",  "sourcetype": "manual"}'
{"text":"Success","code":0}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At least on macOS both version "https" and https seems to works w/o issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 05:35:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516434#M87411</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-27T05:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516513#M87421</link>
      <description>&lt;P&gt;Ahh, finally got it&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k https://splunkindex:8088/services/collector/event -H "Authorization: Splunk b68999b2-9f22-4b53-ba6e-0a8cfd505251" -d "{\"event\": \"Hello, world!\",  \"sourcetype\": \"manual\"}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This post to the rescue&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/td-p/352755" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Getting-Data-In/HTTP-event-collector-error-with-data-format/td-p/352755&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Had to use double quotes around -d and escape them inside the brackets.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;And thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; for helping me!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 13:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516513#M87421</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-08-27T13:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516515#M87422</link>
      <description>&lt;P&gt;Or&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;-d '{"event": "Hello, world!",  "sourcetype": "manual"}'&lt;/PRE&gt;&lt;P&gt;Single quotes outside and double inside. Just like we have on those examples.&lt;/P&gt;&lt;P&gt;Or is it so that in windows those haven't any difference?&lt;/P&gt;&lt;P&gt;But good to know that you mange it and it's working now.&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 13:31:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516515#M87422</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-27T13:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516516#M87423</link>
      <description>&lt;P&gt;For some reason, it did not accept single qoutes on my laptop (windows 10)...&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 13:31:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/516516#M87423</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-08-27T13:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Event collector won't work - only http 404 when trying to post</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/557156#M92201</link>
      <description>&lt;P&gt;Thank you for submitting this solution - after a number of hours of searching for the correct format this works for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 09:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-Event-collector-won-t-work-only-http-404-when-trying-to/m-p/557156#M92201</guid>
      <dc:creator>Borobest</dc:creator>
      <dc:date>2021-06-25T09:57:37Z</dc:date>
    </item>
  </channel>
</rss>

