<?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 Is there a way to validate the URI for HTTP Event Collector? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-validate-the-URI-for-HTTP-Event-Collector/m-p/216629#M42625</link>
    <description>&lt;P&gt;I am trying to leverage Powershell to POST the event in form of JSON. The Invoke-WebRequest does not work well. Is there a way to validate the URI for HTTP Event Collector to rule out the possibility of a wrong URI?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$Token = "B50D09B4-HG24-8N52-JN38-8h8ASD789998"
$URL = "https://localhost:8088/services/collector"
$Headers = @{"Authorization"=("Splunk " + $Token)}
$Body = '{"event" : "Hello !"}' | ConvertTo-Json

$Result = Invoke-WebRequest -URI $URL -Headers $Headers -Body $Body -Method POST -ContentType "Application/JSON"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 23 Feb 2016 16:27:50 GMT</pubDate>
    <dc:creator>gauravmishra15</dc:creator>
    <dc:date>2016-02-23T16:27:50Z</dc:date>
    <item>
      <title>Is there a way to validate the URI for HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-validate-the-URI-for-HTTP-Event-Collector/m-p/216629#M42625</link>
      <description>&lt;P&gt;I am trying to leverage Powershell to POST the event in form of JSON. The Invoke-WebRequest does not work well. Is there a way to validate the URI for HTTP Event Collector to rule out the possibility of a wrong URI?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$Token = "B50D09B4-HG24-8N52-JN38-8h8ASD789998"
$URL = "https://localhost:8088/services/collector"
$Headers = @{"Authorization"=("Splunk " + $Token)}
$Body = '{"event" : "Hello !"}' | ConvertTo-Json

$Result = Invoke-WebRequest -URI $URL -Headers $Headers -Body $Body -Method POST -ContentType "Application/JSON"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 16:27:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-validate-the-URI-for-HTTP-Event-Collector/m-p/216629#M42625</guid>
      <dc:creator>gauravmishra15</dc:creator>
      <dc:date>2016-02-23T16:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to validate the URI for HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-validate-the-URI-for-HTTP-Event-Collector/m-p/216630#M42626</link>
      <description>&lt;P&gt;What error do you get?  Are you including $Token in the request?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 16:38:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-validate-the-URI-for-HTTP-Event-Collector/m-p/216630#M42626</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-02-23T16:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to validate the URI for HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-validate-the-URI-for-HTTP-Event-Collector/m-p/216631#M42627</link>
      <description>&lt;P&gt;Great question! I've added Token as a session variable in my Invoke-WebRequest command, it is working now!&lt;/P&gt;

&lt;P&gt;Here is the command for viewers' reference:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$Result = Invoke-WebRequest -URI $URL -Headers $Headers -Body $Body -Method POST -ContentType "Application/JSON" -SessionVariable "$Token"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you Rich!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 17:02:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-way-to-validate-the-URI-for-HTTP-Event-Collector/m-p/216631#M42627</guid>
      <dc:creator>gauravmishra15</dc:creator>
      <dc:date>2016-02-23T17:02:13Z</dc:date>
    </item>
  </channel>
</rss>

