You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Template management fails to install a template when AWS IAM authentication is used. According to the log it fails to construct URL when signing the AWS request.
To Reproduce
Steps to reproduce the behavior:
Configure logstash output as follows:
opensearch {
auth_type => {
type => "aws_iam"
region => "us-west-2"
}
id => "Write_Events_To_Elasticsearch"
hosts => ["https://open_search_instance.us-west-2.es.amazonaws.com"]
manage_template => true
template_overwrite => true
template => "/usr/share/logstash/files/events.json"
template_name => "events_101"
sniffing => false
index => "events_101-%{+YYYY-MM-dd}"
}
(in my case it takes credentials from the ~/.aws/credentials file, hence they are not specified inside auth_type)
Run the pipeline and observe the exception.
Expected behavior
Template installed without an error.
Plugins
kafka input
opensearch output
Screenshots
N/A
Host/Environment (please complete the following information):
Describe the bug
Template management fails to install a template when AWS IAM authentication is used. According to the log it fails to construct URL when signing the AWS request.
To Reproduce
Steps to reproduce the behavior:
opensearch {
auth_type => {
type => "aws_iam"
region => "us-west-2"
}
id => "Write_Events_To_Elasticsearch"
hosts => ["https://open_search_instance.us-west-2.es.amazonaws.com"]
manage_template => true
template_overwrite => true
template => "/usr/share/logstash/files/events.json"
template_name => "events_101"
sniffing => false
index => "events_101-%{+YYYY-MM-dd}"
}
(in my case it takes credentials from the ~/.aws/credentials file, hence they are not specified inside auth_type)
Expected behavior
Template installed without an error.
Plugins
kafka input
opensearch output
Screenshots
N/A
Host/Environment (please complete the following information):
Additional context
Excerpt from the log:
[2022-02-09T18:26:47,670][INFO ][logstash.outputs.opensearch][main] Installing OpenSearch template {:name=>"events_101"}
[2022-02-09T18:26:47,672][ERROR][logstash.outputs.opensearch][main] Failed to install template {
:message=>"bad component(expected absolute path component): _template/events_101",
:exception=>URI::InvalidComponentError,
:backtrace=>[
"uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/generic.rb:771:in
check_path'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/generic.rb:819:in
path='","uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/generic.rb:193:in
initialize'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/generic.rb:138:in
build'","uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/http.rb:62:in
build'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb:176:in
sign_aws_request'","/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb:154:in
perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:270:in
perform_request_to_url'","/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:257:in
block in perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:346:in
with_connection'","/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:256:in
perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:264:in
block in Pool'","/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client.rb:388:in
template_put'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client.rb:82:in
template_install'","/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/template_manager.rb:37:in
install'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/template_manager.rb:25:in
install_template'","/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch.rb:412:in
install_template'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch.rb:247:in
finish_register'","/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch.rb:224:in
block in register'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/plugin_mixins/opensearch/common.rb:83:in
block in after_successful_connection'"]}
sample template events.json:
{
"order": 0,
"index_patterns": [
"events_101*"
],
"settings": {
"index": {
"codec": "best_compression",
"mapping": {
"ignore_malformed": "true"
},
"refresh_interval": "30s",
"analysis": {
"normalizer": {
"lowercase_normalizer": {
"filter": [
"lowercase"
],
"type": "custom",
"char_filter": []
}
}
},
"number_of_shards": "5",
"number_of_replicas": "1"
}
},
"mappings": {
"_doc": {
"_size": {
"enabled": true
},
"_field_names": {
"enabled": false
},
"dynamic": false,
"properties": {
"id": {
"norms": false,
"index": false,
"type": "keyword",
"doc_values": false
},
"status": {
"normalizer": "lowercase_normalizer",
"type": "keyword"
}
}
}
},
"aliases": {
"events_101": {},
"event_101": {}
}
}
The text was updated successfully, but these errors were encountered: