There is the sameple snippet found online:
var middleware = new HttpEventCollectorResendMiddleware(100);
var ecSender = new HttpEventCollectorSender(new Uri("https://localhost:8088"),
"3E712E99-63C5-4C5A-841D-592DD070DA51",
null,
HttpEventCollectorSender.SendMode.Sequential,
0,
0,
0,
middleware.Plugin
);
ecSender.OnError += o => 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();
I have to playing around with different port and uri but I have no luck populating stuff to splunk. I have change the token as well. Those are the only two things I've change. I've also tried to change .NET framework version from 4.6.1 to 4.5.2 but still no luck. Can someone know what are the most common problem in this scenario?
Hi,
try adding this as the first line of your code:
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
Hi All , I am new to Splunk n facing a similar issue,
Added all dlls from nuget n setup an account with Token,
But I don't see any logs in dash board on search
Need a Help on this
below is the code -
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
var middleware = new HttpEventCollectorResendMiddleware(100);
var ecSender = new HttpEventCollectorSender(new Uri("http://localhost:8088/"),
"bacdb24e-ee37-40cc-8d81-9b2f6d95784f", null, HttpEventCollectorSender.SendMode.Sequential, 0, 0, 0, middleware.Plugin);
ecSender.OnError += o => Console.WriteLine(o.Message);
ecSender.Send(DateTime.UtcNow.AddDays(-1), Guid.NewGuid().ToString(), "INFO", null,
new { Foo = "Bar", test2 = "Testit2", time = ConvertToEpoch(DateTime.UtcNow.AddHours(-2)).ToString(), anotherkey="RohitKeyvalue1" });
ecSender.Send(Guid.NewGuid().ToString(), "INFO", null,
new { Foo = "Bar", test2 = "Testit2", time = ConvertToEpoch(DateTime.UtcNow.AddHours(-2)).ToString(), anotherkey = "RohitKeyvalue2" });
await ecSender.FlushAsync();