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

Does NLog.Targets.ElasticSearch support logging to Elasticsearch 8? #176

Open
mindisk opened this issue Sep 6, 2023 · 5 comments
Open

Comments

@mindisk
Copy link

mindisk commented Sep 6, 2023

I have updated NLog and NLog.Targets.ElasticSearch to latest versions and it worked against Elasticsearch 7. I have upgraded Elasticsearch to version 8. After that, I was unable to write logs to Elasticsearch.

After looking at NLog.Targets.ElasticSearch repository, I noticed that Elasticsearch 8 is not mentioned anywhere and that the latest package targets Elasticserach 7 and not 8.

Is it true that NLog.Targets.ElasticSearch does not support Elasticsearch 8 at the moment?
If it is true, when I could expect support for Elasticsearch 8 to be available?

@boskjoett
Copy link

Adding documentType="" to target xsi:type="ElasticSearch" solved the issue.

<target xsi:type="ElasticSearch" index="${elasticSearchIndex}" uri="${elasticSearchUri}" username="${elasticSearchUsername}" password="${elasticSearchPassword}" documentType="">

It now works with ES 8.

The Versions table on the project front page makes you wonder if ES 8 is supported. I think you should highlight that this project supports ES 8, and mention the empty documentType requirement.

@johnjaylward
Copy link

Looks like data streams are not supported though:

2024-07-30 15:59:27.6445 Error ElasticSearch: Bulk item failed: index:my-stream result: type: error:Type: illegal_argument_exception Reason: "only write ops with an op_type of create are allowed in data streams" CausedBy: "Type: index_not_found_exception Reason: "no such index [my-stream]""

It's true that the my-stream index does not exist since it's actually a data stream

@snakefoot
Copy link
Collaborator

@johnjaylward The Wiki mentions that you can assign opCodeCreate="true" to enable data-streams. See also #132

@johnjaylward
Copy link

will settings opCodeCreate="true" still work for a regular index as well, or only data streams?

@snakefoot
Copy link
Collaborator

No idea. Maybe look in the ElasticSearch-manual or ask ElasticSearch-support or use StackOverflow.com or Google how opCode is working.

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

4 participants