Comments (14)
Hey @pavan2017git,
Glad to see you made some progress. At this stage we are not looking to add the overload for configuration as it would not be great practice. You can still achieve this by passing in the HttpClientHandler
in .NetCore (See this & here) overload.
Check out #26 which is a similar issue.
I will try to track some code, however I think it will be something like the following
var handler = new HttpClientHandler()
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; };
# Then pass handler to the Serilog Splunk Sink as per the overload, which will then be used in the HttpClient
from serilog-sinks-splunk.
Hey @pavan2017git,
Do you have some detail on the exception being thrown? If you have a simple console app try adding the following to get some additional internal information about what is going on within the sink.
Serilog.Debugging.SelfLog.Enable(Console.Error);
Also, what package version are you targeting?
HTH
from serilog-sinks-splunk.
You can also checkout a full working example at https://github.com/serilog/serilog-docker, in particular https://github.com/serilog/serilog-docker/blob/master/console-sample/src/Program.cs#L22
from serilog-sinks-splunk.
Hey Matthew ,
error thrown by application is Security error occured even though passed splunk uri and Token.
serilog 2.6.0 version was targeted.
from serilog-sinks-splunk.
Can you hit the HEC endpoint via a basic curl? e.g. http://dev.splunk.com/view/event-collector/SP-CAAAE7F
from serilog-sinks-splunk.
when I try with curl command It working fine.Problem I was facing when I try to hit from c# application.
I tried this https://github.com/serilog/serilog-docker
but no luck it was return Exception while emitting periodic batch from Serilog.Sinks.Splunk.EventCollectorSink: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
from serilog-sinks-splunk.
Ok, hoping we are getting a little closer, so the URI endpoint is using SSL? Is it a trusted certificate?
Can you try ignoring the SSL validation?
e.g. pass in a HttpClientHandler
as added in #33 & #26
from serilog-sinks-splunk.
Hey Matthew,
I tried by ignoring SSL validation but this time I got below error
Response status code does not indicate success: 401 (Unauthorized).
Below snippet used for Ignoring SSL
Serilog.Debugging.SelfLog.Enable(Console.Error);
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain,
System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true; // **** Always accept
};
from serilog-sinks-splunk.
Hey Matthew,
I have tried https://github.com/serilog/serilog-docker/blob/master/console-sample/src/Program.cs#L22
in console application of .Net framework after bypass SSL validation It got worked.but same code I tried on .NetCore 2.0 Framework again ran into issue security error ocuured
could you suggest me what could be the change need to do in .dotnet core 2.0
from serilog-sinks-splunk.
Hey Matthew,
After by passing SSL validation on Dotnetcore 2.0 it was worked.
so can you please add property to by pass SSL validation.
so that I can directly use your Serilog.Splunk.Sink Nuget package.
from serilog-sinks-splunk.
Hey Matthew,
Inorder to do by pass I would add code what you suggested but using your files in our project that is License compliance.So what steps I should take to achieve this.
from serilog-sinks-splunk.
Hi @pavan2017git,
Did you manage to solve your issue?
from serilog-sinks-splunk.
from serilog-sinks-splunk.
Closing this out as per solution above.
from serilog-sinks-splunk.
Related Issues (20)
- Add default constructor for CustomField
- Splunk sink is not working in asp.net core 6 HOT 4
- Timestamp precision HOT 4
- Issue with overload HOT 1
- Is there any option to set http timeout for Collector HOT 2
- Support set meta data field host easily by code (dynamic resolution) HOT 1
- Support disabling of rendered message HOT 1
- EventCollectorSink relies on sealed type PeriodicBatchingSink HOT 1
- Appveyor/Nuget Package Release HOT 3
- Update security scanning and security policy.
- Fix TCP and UDP package upstream nuget
- Release build script issues
- Just updated from 3.7.0 to 4.0.0/4.0.1 and I cant get splunk to index the data HOT 18
- Bumped to 4.0.2 - Could not load file or assembly 'Serilog.Sinks.Splunk' or one of its dependencies. Strong name signature could not be verified. HOT 3
- [Request for Comments] Gitter vs GitHub Discussions for interactive interaction
- TraceId and SpanId are missing from the logs HOT 4
- Breaking changes between 3.7.0 and 4+ HOT 4
- Update Serilog.Sinks.PeriodicBatching to Version 4.1.0 HOT 2
- Allow for providing splunkHost as-is? HOT 5
- Update 3.7.0 -> 4.1.0 not working HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serilog-sinks-splunk.