Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to push logs to https elasticsearch from aspnet core #70

Open
skamble89 opened this issue Sep 28, 2020 · 3 comments
Open

Unable to push logs to https elasticsearch from aspnet core #70

skamble89 opened this issue Sep 28, 2020 · 3 comments

Comments

@skamble89
Copy link

I am unable to push logs to elasticsearch over ssl

ASP.NET Core version: 2.1
log4stash package version: 3.0.0

Elasticsearch certificate is not a self signed certificate so I have not added the SelfSignedCertificate flag in configuration. Also since it is a dev setup, the server certificate as well as the CA certificate were generated manually

<appender name="ElasticSearchAppender" type="log4stash.ElasticSearchAppender, log4stash"> <Server>%ES_HOST%</Server> <Port>%ES_PORT%</Port> <IndexName>index-%{+yyyy-MM-dd}</IndexName> <Ssl>True</Ssl> <AuthenticationMethod> <Basic> <Username>[username]</Username> <Password>[password]</Password> </Basic> </AuthenticationMethod> </appender>

I am not sure what additional information I could provide. Would really appreciate if you could help me with this.

Thanks,
Saurabh

@adamcti
Copy link

adamcti commented Jun 6, 2024

where you able to solve this issue?

@skamble89
Copy link
Author

skamble89 commented Jun 8, 2024

Hi @adamcti

We just used the http endpoint and moved on.

However, having a look at the code of log4stash, I believe creating a certificate which matches the conditions inside this function should work.

Do let me know if you are able to get your problem resolved.

Note: I haven't tried the approach

@danammeansbear
Copy link

So I was able to use the HTTP method to send a log message over c# like so but im not sure what you mean by create a certificate for log4stash

// Ignore SSL certificate errors (not recommended for production) var handler = new HttpClientHandler(); handler.ServerCertificateCustomValidationCallback = (HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors) => true; var client = new HttpClient(handler);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants