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

Elasticsearch Specifying types in bulk requests is deprecated #225

Closed
xuwupeng2000 opened this issue Aug 10, 2022 · 4 comments
Closed

Elasticsearch Specifying types in bulk requests is deprecated #225

xuwupeng2000 opened this issue Aug 10, 2022 · 4 comments

Comments

@xuwupeng2000
Copy link

xuwupeng2000 commented Aug 10, 2022

Environment

Provide at least:

  • Ruby Version: 3.1.2
  • Semantic Logger Version: 4.11.0
  • Application/framework names and versions: Rails 7.0.3
  • Rails Semantic Logger Version: rails_semantic_logger: 4.10.0

Expected Behavior

Actual Behavior

config.semantic_logger.add_appender(appender: :elasticsearch, url: "http://localhost:9200")

configure the logger to forward log to elasticsearch and get this in console:

^Cwarning: 299 Elasticsearch-7.14.2-6bc13727ce758c0e943c3c21653b3da82f627f75 "[types removal] Specifying types in bulk requests is deprecated."

Clearly, there is method used has been deprecated for ES7.
ES7 doesn't support bulk requests with type.

@xuwupeng2000
Copy link
Author

Just report this one to see if anyone has the same issue. I will come back and provide a fix.

@shaunbugler
Copy link

Yes this was raised in #167 but issue was closed, there is a work around but setting type must be removed if you want to use ES 8.X

@reidmorrison
Copy link
Owner

Anyone want to submit a Pull Request to fix the ES appender so that it is compatible with both the older and latest ES?

picandocodigo added a commit to picandocodigo/semantic_logger that referenced this issue Oct 18, 2023
Elasticsearch Appender.

I tested this code with 6.x, 7.x and 8.x. For testing with the
different versions, I think we would need to add different gemfiles
and run the tests with each version, but I don't know if that's worth
it or something you'd like to have since it'd be quite an overhead.

I added a helper to the tests. For versions < 8.0.0,
Elasticsearch::Transport::Client and Elasticsearch::Client could be
used to call `bulk`, but since we extracted Transport into its own
library, you need to call Elasticsearch::Client for bulk.

Addresses reidmorrison#225
@reidmorrison
Copy link
Owner

New gem published with the merged PR.

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

No branches or pull requests

3 participants