<?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 data input in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-data-input/m-p/573866#M101494</link>
    <description>&lt;P&gt;I'm trying to post REST data via HTTP to splunk.&amp;nbsp; This works when using a pre-generated token to an HEC:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;POST /services/collector/event HTTP/1.0\r\nHost: galaxy.xypro.com\r\nContent-Type: application/json\r\nKeep-Alive: 100\r\nConnection: keep-alive\r\nAuthorization: Splunk 1d07454b-d9ef-41b0-9450-59d8670a78c7\r\nContent-Length: 166\r\n\r\n{\"time\": 1636117458, \"host\": \"galaxy.xypro.com\", \"source\": \"test\", \"event\": { \"message\": \"2021-11-05:13:04:18.491986: Logging test message #0\", \"severity\": \"INFO\" } }&lt;/P&gt;&lt;P&gt;HTTP/1.1 200 OK\r\nDate: Fri, 05 Nov 2021 20:05:17 GMT\r\nContent-Type: application/json; charset=UTF-8\r\nX-Content-Type-Options: nosniff\r\nContent-Length: 27\r\nVary: Authorization\r\nConnection: Keep-Alive\r\nX-Frame-Options: SAMEORIGIN\r\nServer: Splunkd\r\n\r\n{\"text\":\"Success\",\"code\":0}&lt;/P&gt;&lt;P&gt;However, when I try to generate a session token to allow basic authorization, I see the following response, even though the user and password are correct:&lt;BR /&gt;&lt;BR /&gt;POST &lt;A href="HTTPS://localhost:8089/services/auth/login" target="_blank" rel="noopener"&gt;HTTPS://localhost:8089/services/auth/login&lt;/A&gt; HTTP/1.0\r\nHost: galaxy.xypro.com\r\nContent-Type: application/json\r\nKeep-Alive: 100\r\nConnection: keep-alive\r\nAuthorization: Basic a3B3YXRlcnNvbjpUZXN0MTIzNDU=\r\nContent-Length: 48\r\n\r\n{\"username\":\"kpwaterson\",\"password\":\"Test12345\"}&lt;/P&gt;&lt;P&gt;HTTP/1.1 400 Bad Request\r\nDate: Fri, 05 Nov 2021 19:57:40 GMT\r\nExpires: Thu, 26 Oct 1978 00:00:00 GMT\r\nCache-Control: no-store, no-cache, must-revalidate, max-age=0\r\nContent-Type: text/xml; charset=UTF-8\r\nX-Content-Type-Options: nosniff\r\nContent-Length: 129\r\nConnection: Keep-Alive\r\nX-Frame-Options: SAMEORIGIN\r\nServer: Splunkd\r\n\r\n&amp;lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&amp;gt;\n&amp;lt;response&amp;gt;\n &amp;lt;messages&amp;gt;\n &amp;lt;msg type=\"WARN\"&amp;gt;Login failed&amp;lt;/msg&amp;gt;\n &amp;lt;/messages&amp;gt;\n&amp;lt;/response&amp;gt;\n&lt;/P&gt;&lt;P&gt;I was also investigating using receivers\simple for http messages.&amp;nbsp; Although the message is posted to splunk, a response is never received.&lt;/P&gt;&lt;P&gt;POST /services/receivers/simple?source=NonStop&amp;amp;index=main&amp;amp;sourcetype=json_no_timestamp HTTP/1.0\r\nHost: galaxy.xypro.com\r\nContent-Type: application/json\r\nKeep-Alive: 100\r\nConnection: keep-alive\r\nAuthorization: Bearer eyJraWQiOiJzcGx1bmsuc2VjcmV0IiwiYWxnIjoiSFM1MTIiLCJ2ZXIiOiJ2MiIsInR0eXAiOiJzdGF0aWMifQ.eyJpc3MiOiJrZW4ud2F0ZXJzb24gZnJvbSBWTS1ERVYtU1BMVU5LIiwic3ViIjoia2VuLndhdGVyc29uIiwiYXVkIjoiRGV2ZWxvcG1lbnQiLCJpZHAiOiJMREFQOi8vbWZhIiwianRpIjoiODUzMDYyZmFhZjA0NWY0Y2JlMWEyNGMxZWE3NTAyYjRmMjEwMGEyNzE0NzA1N2Q0MmUxOGVkYWRlMTYyZTlkZiIsImlhdCI6MTYzMzUyNTE5MywiZXhwIjoxNjM2MTE3MTkzLCJuYnIiOjE2MzM1MjUxOTN9.3TKSCeK52awMJDxNzfvfW4PNewsGVlKkFXSf0Vy1Dv7JH4DNH9Ogn_w5WZLkZkeNXmjJqU8opORXW7DjxA2eag\r\nContent-Length: 166\r\n\r\n{\"time\": 1636117714, \"host\":\"galaxy.xypro.com\", \"source\": \"test\", \"event\": { \"message\": \"2021-11-05:13:08:34.900042: Logging test message #0\", \"severity\": \"INFO\" } }&lt;/P&gt;&lt;P&gt;Could you please let me know what may be the issue with generating the session key and why a response is not received from receivers/simple?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Nov 2021 21:02:51 GMT</pubDate>
    <dc:creator>kpwaterson</dc:creator>
    <dc:date>2021-11-05T21:02:51Z</dc:date>
    <item>
      <title>HTTP data input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-data-input/m-p/573866#M101494</link>
      <description>&lt;P&gt;I'm trying to post REST data via HTTP to splunk.&amp;nbsp; This works when using a pre-generated token to an HEC:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;POST /services/collector/event HTTP/1.0\r\nHost: galaxy.xypro.com\r\nContent-Type: application/json\r\nKeep-Alive: 100\r\nConnection: keep-alive\r\nAuthorization: Splunk 1d07454b-d9ef-41b0-9450-59d8670a78c7\r\nContent-Length: 166\r\n\r\n{\"time\": 1636117458, \"host\": \"galaxy.xypro.com\", \"source\": \"test\", \"event\": { \"message\": \"2021-11-05:13:04:18.491986: Logging test message #0\", \"severity\": \"INFO\" } }&lt;/P&gt;&lt;P&gt;HTTP/1.1 200 OK\r\nDate: Fri, 05 Nov 2021 20:05:17 GMT\r\nContent-Type: application/json; charset=UTF-8\r\nX-Content-Type-Options: nosniff\r\nContent-Length: 27\r\nVary: Authorization\r\nConnection: Keep-Alive\r\nX-Frame-Options: SAMEORIGIN\r\nServer: Splunkd\r\n\r\n{\"text\":\"Success\",\"code\":0}&lt;/P&gt;&lt;P&gt;However, when I try to generate a session token to allow basic authorization, I see the following response, even though the user and password are correct:&lt;BR /&gt;&lt;BR /&gt;POST &lt;A href="HTTPS://localhost:8089/services/auth/login" target="_blank" rel="noopener"&gt;HTTPS://localhost:8089/services/auth/login&lt;/A&gt; HTTP/1.0\r\nHost: galaxy.xypro.com\r\nContent-Type: application/json\r\nKeep-Alive: 100\r\nConnection: keep-alive\r\nAuthorization: Basic a3B3YXRlcnNvbjpUZXN0MTIzNDU=\r\nContent-Length: 48\r\n\r\n{\"username\":\"kpwaterson\",\"password\":\"Test12345\"}&lt;/P&gt;&lt;P&gt;HTTP/1.1 400 Bad Request\r\nDate: Fri, 05 Nov 2021 19:57:40 GMT\r\nExpires: Thu, 26 Oct 1978 00:00:00 GMT\r\nCache-Control: no-store, no-cache, must-revalidate, max-age=0\r\nContent-Type: text/xml; charset=UTF-8\r\nX-Content-Type-Options: nosniff\r\nContent-Length: 129\r\nConnection: Keep-Alive\r\nX-Frame-Options: SAMEORIGIN\r\nServer: Splunkd\r\n\r\n&amp;lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&amp;gt;\n&amp;lt;response&amp;gt;\n &amp;lt;messages&amp;gt;\n &amp;lt;msg type=\"WARN\"&amp;gt;Login failed&amp;lt;/msg&amp;gt;\n &amp;lt;/messages&amp;gt;\n&amp;lt;/response&amp;gt;\n&lt;/P&gt;&lt;P&gt;I was also investigating using receivers\simple for http messages.&amp;nbsp; Although the message is posted to splunk, a response is never received.&lt;/P&gt;&lt;P&gt;POST /services/receivers/simple?source=NonStop&amp;amp;index=main&amp;amp;sourcetype=json_no_timestamp HTTP/1.0\r\nHost: galaxy.xypro.com\r\nContent-Type: application/json\r\nKeep-Alive: 100\r\nConnection: keep-alive\r\nAuthorization: Bearer eyJraWQiOiJzcGx1bmsuc2VjcmV0IiwiYWxnIjoiSFM1MTIiLCJ2ZXIiOiJ2MiIsInR0eXAiOiJzdGF0aWMifQ.eyJpc3MiOiJrZW4ud2F0ZXJzb24gZnJvbSBWTS1ERVYtU1BMVU5LIiwic3ViIjoia2VuLndhdGVyc29uIiwiYXVkIjoiRGV2ZWxvcG1lbnQiLCJpZHAiOiJMREFQOi8vbWZhIiwianRpIjoiODUzMDYyZmFhZjA0NWY0Y2JlMWEyNGMxZWE3NTAyYjRmMjEwMGEyNzE0NzA1N2Q0MmUxOGVkYWRlMTYyZTlkZiIsImlhdCI6MTYzMzUyNTE5MywiZXhwIjoxNjM2MTE3MTkzLCJuYnIiOjE2MzM1MjUxOTN9.3TKSCeK52awMJDxNzfvfW4PNewsGVlKkFXSf0Vy1Dv7JH4DNH9Ogn_w5WZLkZkeNXmjJqU8opORXW7DjxA2eag\r\nContent-Length: 166\r\n\r\n{\"time\": 1636117714, \"host\":\"galaxy.xypro.com\", \"source\": \"test\", \"event\": { \"message\": \"2021-11-05:13:08:34.900042: Logging test message #0\", \"severity\": \"INFO\" } }&lt;/P&gt;&lt;P&gt;Could you please let me know what may be the issue with generating the session key and why a response is not received from receivers/simple?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 21:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-data-input/m-p/573866#M101494</guid>
      <dc:creator>kpwaterson</dc:creator>
      <dc:date>2021-11-05T21:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP data input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-data-input/m-p/573896#M101499</link>
      <description>&lt;P&gt;receivers/simple does not return anything. It's by design.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.3/RESTREF/RESTinput#receivers.2Fsimple" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.3/RESTREF/RESTinput#receivers.2Fsimple&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the services/auth/login you're supplying parameters wrong. Firstly - you're mixing simple http auth, which is not needed with login endpoint. Secondly - you're posting json structure instead of fields &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/RESTUM/RESTusing#Authentication_with_HTTP_Authorization_tokens" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/RESTUM/RESTusing#Authentication_with_HTTP_Authorization_tokens&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Nov 2021 08:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-data-input/m-p/573896#M101499</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-11-06T08:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP data input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/HTTP-data-input/m-p/574062#M101504</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; FYI, the authorization header token is ignored, it doesn't matter whether it is included or not, but the issue was resolved by not using JSON.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, including the Accept header does not change the format of the response - do you know if this is always XML?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 18:28:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/HTTP-data-input/m-p/574062#M101504</guid>
      <dc:creator>kpwaterson</dc:creator>
      <dc:date>2021-11-08T18:28:07Z</dc:date>
    </item>
  </channel>
</rss>

