Logstash : Elasticsearch input plugin not working with a remote server

Hello,

I have logstash installed on my PC and there is a Amazon Linux 2 AMI machine contains Kubernetes ( Elasticsearch and Ngnix)

There is ssl installed on the server but i can make queries from postman on my pc using http ( not https ) and without providing any certificate

the problem now is with logstash , the conf file not working and return the following

Error: [308]

308 Permanent Redirect

308 Permanent Redirect


nginx

Exception: Elasticsearch::Transport::Transport::Errors::PermanentRedirect

my conf file is looking like


input {
     elasticsearch {
        hosts => ["http://serverurlishere.com"]
        index => "myindex"
        user => "bassem"
        password => "mypasswordishere"
      	query => '{"query": {"match": {"gender": "Male"}}}'
    }
}

Can you update your hosts directive to point to their new location?

The client libraries being used do not follow HTTP 308 redirects.

They are technically in compliance with RFC-7538 that introduces them, which specifies that:

The user agent MAY use the Location field value for automatic redirection

The RFC outlines Deployment Considerations:

Section 6 of [RFC7231] requires recipients to treat unknown 3xx status codes the same way as status code 300 (Multiple Choices) ([RFC7231], Section 6.4.1). Thus, servers will not be able to rely on automatic redirection happening similar to status codes 301, 302, or 307. Therefore, the use of status code 308 is restricted to cases where the server has sufficient confidence in the client's understanding the new code or when a fallback to the semantics of status code 300 is not problematic.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.