reidmorrison / semantic_logger

Semantic Logger is a feature rich logging framework, and replacement for existing Ruby & Rails loggers.
https://logger.rocketjob.io/
Apache License 2.0
873 stars 124 forks source link

Adds support for newer versions of Elasticsearch that removed _type in Elasticsearch Appender #275

Closed picandocodigo closed 1 year ago

picandocodigo commented 1 year ago

Issue #225

Description of changes

Adds support for newer versions of Elasticsearch that removed _type in Elasticsearch Appender.

Hi @reidmorrison, I tested this code with 6.x, 7.x and 8.x. For integrating the tests 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. Let me know.

I added a helper function 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.

Let me know what you think. For ElasticsearchHTTP, you'd need to make a call to / in the Elasticsearch instance to find out the version, and if it's 7 or 8 remove type from the path. Let me know if you'd like me to add this.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

reidmorrison commented 1 year ago

Thank you for the fixes. :tada: