<?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 Send JSON objects to HTTP Event Collector using .NET in Security</title>
    <link>https://community.splunk.com/t5/Security/Send-JSON-objects-to-HTTP-Event-Collector-using-NET/m-p/296409#M7938</link>
    <description>&lt;P&gt;I am having a hard time trying to send data to splunk. Here is the snippet of the code found online (official as well) for Http Event Collector:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var middleware = new HttpEventCollectorResendMiddleware(100);
var ecSender = new HttpEventCollectorSender(new Uri(“https://localhost:8088”), //I believe the port should be on the "token" page.
    “3E712E99-63C5-4C5A-841D-592DD070DA51”, //token from splunk "token"page.
    null,
    HttpEventCollectorSender.SendMode.Sequential, 
    0,
    0,
    0,
    middleware.Plugin
);

ecSender.OnError += o =&amp;gt; Console.WriteLine(o.Message);

ecSender.Send(Guid.NewGuid().ToString(), “INFO”, null, new { Foo = “Bar” });

dynamic obj = new JObject();

obj.Bar = “Baz”;

ecSender.Send(Guid.NewGuid().ToString(), “INFO”, null, (JObject) obj);

await ecSender.FlushAsync();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Nothing would show up in Splunk searches. I've tried to switch .NET Framework version from 4.6.1 to 4.5.2 (I am on visual studio 2017) but no luck.&lt;BR /&gt;
I am wondering what are the most common problem dealing with this problem. I was guessing maybe the "Uri" or "token" was incorrect, but i've tried all possible port on the Uri. Maybe someone can clarify what I'm missing here. Is there a different sending this to cloud or enterprise? &lt;/P&gt;</description>
    <pubDate>Thu, 29 Mar 2018 05:12:25 GMT</pubDate>
    <dc:creator>johnchen0213</dc:creator>
    <dc:date>2018-03-29T05:12:25Z</dc:date>
    <item>
      <title>Send JSON objects to HTTP Event Collector using .NET</title>
      <link>https://community.splunk.com/t5/Security/Send-JSON-objects-to-HTTP-Event-Collector-using-NET/m-p/296409#M7938</link>
      <description>&lt;P&gt;I am having a hard time trying to send data to splunk. Here is the snippet of the code found online (official as well) for Http Event Collector:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var middleware = new HttpEventCollectorResendMiddleware(100);
var ecSender = new HttpEventCollectorSender(new Uri(“https://localhost:8088”), //I believe the port should be on the "token" page.
    “3E712E99-63C5-4C5A-841D-592DD070DA51”, //token from splunk "token"page.
    null,
    HttpEventCollectorSender.SendMode.Sequential, 
    0,
    0,
    0,
    middleware.Plugin
);

ecSender.OnError += o =&amp;gt; Console.WriteLine(o.Message);

ecSender.Send(Guid.NewGuid().ToString(), “INFO”, null, new { Foo = “Bar” });

dynamic obj = new JObject();

obj.Bar = “Baz”;

ecSender.Send(Guid.NewGuid().ToString(), “INFO”, null, (JObject) obj);

await ecSender.FlushAsync();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Nothing would show up in Splunk searches. I've tried to switch .NET Framework version from 4.6.1 to 4.5.2 (I am on visual studio 2017) but no luck.&lt;BR /&gt;
I am wondering what are the most common problem dealing with this problem. I was guessing maybe the "Uri" or "token" was incorrect, but i've tried all possible port on the Uri. Maybe someone can clarify what I'm missing here. Is there a different sending this to cloud or enterprise? &lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 05:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Send-JSON-objects-to-HTTP-Event-Collector-using-NET/m-p/296409#M7938</guid>
      <dc:creator>johnchen0213</dc:creator>
      <dc:date>2018-03-29T05:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Send JSON objects to HTTP Event Collector using .NET</title>
      <link>https://community.splunk.com/t5/Security/Send-JSON-objects-to-HTTP-Event-Collector-using-NET/m-p/296410#M7939</link>
      <description>&lt;P&gt;Hey@johnchen0213,&lt;/P&gt;

&lt;P&gt;Refer this link:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.3/Data/UsetheHTTPEventCollector"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.3/Data/UsetheHTTPEventCollector&lt;/A&gt;&lt;BR /&gt;
Let me know if this helps!!&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 07:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Send-JSON-objects-to-HTTP-Event-Collector-using-NET/m-p/296410#M7939</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-03-31T07:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Send JSON objects to HTTP Event Collector using .NET</title>
      <link>https://community.splunk.com/t5/Security/Send-JSON-objects-to-HTTP-Event-Collector-using-NET/m-p/296411#M7940</link>
      <description>&lt;P&gt;Did you download splunk extension for visual studio? Also check with prerequisite:&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/splunk-loglib-dotnet/SP-CAAAEYB"&gt;http://dev.splunk.com/view/splunk-loglib-dotnet/SP-CAAAEYB&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also take a look at troubleshoot steps:&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/splunk-loglib-dotnet/SP-CAAAE6S"&gt;http://dev.splunk.com/view/splunk-loglib-dotnet/SP-CAAAE6S&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 07:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Send-JSON-objects-to-HTTP-Event-Collector-using-NET/m-p/296411#M7940</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-01T07:08:00Z</dc:date>
    </item>
  </channel>
</rss>

