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

[BUG]There is a bug in parsing the host when ssl is set to true #29

Open
naveentatikonda opened this issue Mar 17, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@naveentatikonda
Copy link
Member

What is the bug?
When the "https" protocol is provided in the host url and ssl is enabled. Then, it is throwing the below error

[ERROR][logstash.javapipeline    ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<Manticore::ResolutionFailure: https: nodename nor servname provided, or not known>

It is the parsing the host "https://localhost:9200" as
Hosts: [{:host=>"https", :scheme=>"https", :port=>"//localhost"}]
https://github.com/opensearch-project/logstash-input-opensearch/blob/main/lib/logstash/inputs/opensearch.rb#L355-L359

The same configuration works fine if we provide the host name without protocol like "localhost:9200"

How can one reproduce the bug?

  1. Clone the repository
  2. Install this plugin onto logstash by following the instructions in DeveloperGuide.
  3. Update the pipeline configuration using the sample configuration shown below
input {
 opensearch {
     hosts => "https://localhost:9200"
     user => "admin"
     password => "admin"
     index => "test"
     ssl => true
     ssl_certificate_verification => false
     query => '{ "query": { "match_all": {}}, "sort": [ "_doc" ] }'
  }
}

output {
stdout {}
}
  1. Run it to get the error shown above.

What is the expected behavior?
It should fetch the documents from the index based on the given query.

@naveentatikonda naveentatikonda added the bug Something isn't working label Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant