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

Vendor Elasticsearch 9 templates in the generated gem #1188

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

andsel
Copy link
Contributor

@andsel andsel commented Sep 13, 2024

Release notes

Vendor ECS template for Elasticsearch 9.x in built gem

What does this PR do?

Update Rakefile to vendor ECS schema template v8 for Elasticsearch 9

Why is it important/What is the impact to the user?

Let the plugin work with Elaticsearch 9 templates

Checklist

  • My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • [ ] I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • vendor and build locally the gem

How to test this PR locally

  • vendor the gem
rake vendor
gem build 
  • unpack the gem and verify that contains the templates
gem unpack logstash-output-elasticsearch-11.22.9-java.gem
tree logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch/templates/

Related issues

Use cases

Screenshots

Logs

[WARN ] 2024-09-13 09:54:08.763 [[test2]-pipeline-manager] javapipeline - 'pipeline.ordered' is enabled and is likely less efficient, consider disabling if preserving event order is not necessary
[INFO ] 2024-09-13 09:54:08.766 [Ruby-0-Thread-14: /path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/plugin_mixins/elasticsearch/common.rb:164] elasticsearch - Using a default mapping template {:es_version=>9, :ecs_compatibility=>:v8}
[INFO ] 2024-09-13 09:54:08.766 [Ruby-0-Thread-15: /path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/plugin_mixins/elasticsearch/common.rb:164] elasticsearch - Using a default mapping template {:es_version=>9, :ecs_compatibility=>:v8}
[ERROR] 2024-09-13 09:54:08.766 [Ruby-0-Thread-14: /path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/plugin_mixins/elasticsearch/common.rb:164] 
	elasticsearch - Failed to install template {
		:message=>"Failed to load default template for Elasticsearch v9 with ECS v8; caused by: #<LogStash::ConfigurationError: Failed to load template file '/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch/templates/ecs-v8/elasticsearch-9x.json': Template file '/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch/templates/ecs-v8/elasticsearch-9x.json' could not be found>", 
		:exception=>LogStash::ConfigurationError, 
		:backtrace=>[
		"/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch/template_manager.rb:40:in `load_default_template'", 
		"/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch/template_manager.rb:27:in `install_template'", "/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch.rb:663:in `install_template'", 
		"/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch.rb:371:in `finish_register'", 
		"/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/outputs/elasticsearch.rb:328:in `block in register'", 
		"/path/to/logstash-9.0.0-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-output-elasticsearch-11.22.8-java/lib/logstash/plugin_mixins/elasticsearch/common.rb:172:in `block in after_successful_connection'"
		]
	}

https://buildkite.com/elastic/logstash-pull-request-pipeline/builds/1457#0191e54c-3934-4a5d-a1df-636cbe9358df/2224-2521

@andsel andsel self-assigned this Sep 13, 2024
@andsel andsel changed the title Vendor Elasticsearch 9 temapltes in the generated gem Vendor Elasticsearch 9 templates in the generated gem Sep 13, 2024
@andsel andsel merged commit d5f0130 into logstash-plugins:main Sep 13, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants