<?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: How to check if an HEC is up or not before posting any data to it? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/605301#M105226</link>
    <description>&lt;P&gt;With these tests, I can check if the Splunk side of the HEC is correctly configured. Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/147730"&gt;@spavin&lt;/a&gt;!!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2022 14:19:41 GMT</pubDate>
    <dc:creator>PvandenHondel</dc:creator>
    <dc:date>2022-07-12T14:19:41Z</dc:date>
    <item>
      <title>How to check if an HEC is up or not before posting any data to it?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417404#M95559</link>
      <description>&lt;P&gt;Hi, I am trying to post data to Splunk using HEC. But before posting I want to check if the endpoint I'm trying to post data to is up or not. How can I check that.&lt;/P&gt;

&lt;P&gt;e.g: There is on HEC - Named Test with auth token "d51d25fc-6fa2-4841-b430-be55876332b7". I post data using curl request -&lt;BR /&gt;
curl -k &lt;A href="http://localhost:8088/services/collector"&gt;http://localhost:8088/services/collector&lt;/A&gt; -H 'Authorization: Splunk d51d25fc-6fa2-4841-b430-be55876332b7' -d '{"sourcetype": "input", "event":"Hello, World!"}'&lt;/P&gt;

&lt;P&gt;How can we check if that particular endpoint is up and accepting data input. &lt;/P&gt;

&lt;P&gt;Please note that this is our customer Splunk endpoint, hence we have only the HEC URL and AuthToken. And we don't want to post any dummy data just to check if the post is successful or not.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 11:02:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417404#M95559</guid>
      <dc:creator>sathwikakamai</dc:creator>
      <dc:date>2019-02-28T11:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if an HEC is up or not before posting any data to it?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417405#M95560</link>
      <description>&lt;P&gt;Hi @sathwikakamai,&lt;/P&gt;

&lt;P&gt;If you are confident that the HEC endpoint is set up correctly, there are no firewall restrictions between you and it, and the authorization token is correct, you should be able to run the following curl command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k &lt;A href="https://localhost:8088/services/collector" target="test_blank"&gt;https://localhost:8088/services/collector&lt;/A&gt; -H 'Authorization: Splunk d51d25fc-6fa2-4841-b430-be55876332b7' -d ''
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It will return something like:&lt;BR /&gt;
&lt;CODE&gt;{"text":"No data","code":5}&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It will not submit any data to the index, but it will check that:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;There are no firewall issues between where you ran the command and the HEC endpoint&lt;/LI&gt;
&lt;LI&gt;The authentication token is correct, and working&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;You can add an additional check by supplying an index that you expect to be valid, while still not sending an event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k &lt;A href="https://localhost:8088/services/collector" target="test_blank"&gt;https://localhost:8088/services/collector&lt;/A&gt; -H 'Authorization: Splunk d51d25fc-6fa2-4841-b430-be55876332b7' -d '{"index":"my_index"}'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The response will either tell you that the index is incorrect (meaning the HEC endpoint doesn't allow adding events to that index), or that there was no event supplied - indicating that the index is allowed.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2019 01:28:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417405#M95560</guid>
      <dc:creator>spavin</dc:creator>
      <dc:date>2019-03-03T01:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if an HEC is up or not before posting any data to it?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417406#M95561</link>
      <description>&lt;P&gt;Thanks @spavin , it was very helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 17:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417406#M95561</guid>
      <dc:creator>sathwikakamai</dc:creator>
      <dc:date>2019-03-29T17:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if an HEC is up or not before posting any data to it?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417407#M95562</link>
      <description>&lt;P&gt;You can also check the health endpoint.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;curl -k &lt;A href="https://localhost:8088/services/collector/health" target="test_blank"&gt;https://localhost:8088/services/collector/health&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You should get a response similar to:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;{"text":"HEC is healthy","code":17}&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Note that this doesn't validate your token.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 22:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/417407#M95562</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2019-04-16T22:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if an HEC is up or not before posting any data to it?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/605301#M105226</link>
      <description>&lt;P&gt;With these tests, I can check if the Splunk side of the HEC is correctly configured. Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/147730"&gt;@spavin&lt;/a&gt;!!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 14:19:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/605301#M105226</guid>
      <dc:creator>PvandenHondel</dc:creator>
      <dc:date>2022-07-12T14:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if an HEC is up or not before posting any data to it?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/643457#M109628</link>
      <description>&lt;P&gt;Is this better than calling the /health endpoint? Or was this answer written before that existed?&lt;BR /&gt;&lt;BR /&gt;IE:&amp;nbsp;&lt;A href="https://localhost:8088/services/collector/health" target="_blank"&gt;https://localhost:8088/services/collector/health&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 03:43:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-check-if-an-HEC-is-up-or-not-before-posting-any-data-to/m-p/643457#M109628</guid>
      <dc:creator>orangered6000</dc:creator>
      <dc:date>2023-05-16T03:43:04Z</dc:date>
    </item>
  </channel>
</rss>

