Activity Feed
- Got Karma for Re: Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud?. 06-05-2020 12:48 AM
- Posted Re: Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-03-2016 09:25 AM
- Posted Re: Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-03-2016 08:52 AM
- Posted Re: HTTP Event Collector returns Bad Request - what is wrong with my event? on Getting Data In. 12-03-2016 08:24 AM
- Posted Re: How to set the Metadata field using the Splunk .Net logging library HttpEventCollectorSender? on Getting Data In. 12-02-2016 02:10 PM
- Posted Re: Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-02-2016 10:28 AM
- Posted Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-02-2016 09:44 AM
- Tagged Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-02-2016 09:44 AM
- Tagged Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-02-2016 09:44 AM
- Tagged Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-02-2016 09:44 AM
- Tagged Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-02-2016 09:44 AM
- Tagged Splunk Logging Libraries for .NET: Is there a C# sample code for HTTP Event Collector that works with Splunk Cloud? on Getting Data In. 12-02-2016 09:44 AM
Topics I've Started
Subject | Karma | Author | Latest Post |
---|---|---|---|
0 |
12-03-2016
09:25 AM
1 Karma
Okay I figured it out. The default timestamp has "," in the it and this is not according jSON datetime format. changed my console app default culture, and it worked.
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
... View more
12-03-2016
08:52 AM
I would answer my question self:
Here is the way to create a Metadata for for index:
var meta = new HttpEventCollectorEventInfo.Metadata(index: "loggly", source: "microservice1", sourceType: "_json", host: "numb");
but the challenge i guess is not the INDEX, but the time format, If I remove values after commma in the time then it works,
{"time":"1480703033","event":{"id":"0","severity":"Information","message":"WannaBeCloudLoggingSystem"}}
but why does Splunk Cloud not accept its own time format as described here?
http://dev.splunk.com/view/event-collector/SP-CAAAE6P
... View more
12-03-2016
08:24 AM
Removing timestamp worked for me , but why splunk does not accept its default time format is really something some has to find:
this what it says about time:
"time" The event time. The default time format is epoch time format, in the format . . For example, 1433188255.500 indicates 1433188255 seconds and 500 milliseconds after epoch, or Monday, June 1, 2015, at 7:50:55 PM GMT.
it should have worked, but why it does not work?, Is it worth using SplunkCloud support for programming questions?
... View more
12-02-2016
02:10 PM
MetaData property are read-only says it when i try to initialize, Could you share code please?
... View more
12-02-2016
10:28 AM
Just sniffed what httpEventCollector .NET logging library is doing, I can see its posting following _Json object;
{"time":"1480703033,509","event":{"id":"0","severity":"Information","message":"WannaBeCloudLoggingSystem"}}
This would not work, since its missing index values;
How to set Index within c# Code?
Here is my Code;
var traceSource = new TraceSource("MyConsoleApp");
traceSource.Switch.Level = SourceLevels.All;
traceSource.Listeners.Clear();
var myListener = new HttpEventCollectorTraceListener(
uri: new Uri("https://http-inputs-crapcloudlogger.splunkcloud.com/services/collector/event"),
token: "T O K E N");
myListener.AddLoggingFailureHandler((HttpEventCollectorException e) => {
Console.WriteLine("{0}", e);
});
try
{
traceSource.Listeners.Add(myListener);
}
catch(Exception ex)
{ Console.WriteLine("{0}", ex);
}
traceSource.TraceEvent(TraceEventType.Information,0,"WannaBeCloudLoggingSystem");
... View more
12-02-2016
09:44 AM
Splunk Logging Libraries for .NET: http://dev.splunk.com/view/splunk-loglib-dotnet/SP-CAAAEX4
Most of the samples and articles on this website tells about hosted version of Splunk Enterprise. These code samples does not work with Splunk Cloud. Could anyone post a C# sample code for HTTP Event Collector that really works with Splunk Cloud?
... View more