Logstash Connectivity Issue with Elastic Search on Elastic Cloud

I am not able to connect my logstash instance on my local server with Elastic Search on Elastic Cloud . The user tag in logstash encodes the @ symbol in the email address twice to %2540. I guess because of this Elastic Cloud is not able to identify the credentials specified on logstash.config file.

I have provided the valid Cloud ID and Cloud Authentication Details in logstash.yml file

input {
  file {
    path => "C:/Users/abc/Downloads/reed_uk.csv"
    start_position => "beginning"
  }
}

filter {
      csv {
        columns => [ "category","city","company_name","geo","job_board","job_description","job_requirements","job_title","job_type","post_date","salary_offered","state" ]
     }
    }

output {
  elasticsearch { 
  hosts => ["https://444d61228d4d407f8e42b438e01b28c1.us-east-1.aws.found.io:9243"]
  user => <Elastic-Cloud-Email-Address}
  password => <Elastic-Cloud-Password}
  index => "sampleindex"
  }
  stdout {}

 }

This is the error I am getting on starting logstash on my local server -

error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'https://444d61228d4d407f8e42b438e01b28c1.us-east-1.aws.found.io:9243/'"} 

Are you quoting the password? If not, try that.

I have provided the user as elastic in double quotes and password in the same manner as well.

Along with that I have provided the valid cloud.id and cloud.auth in logstash.yml. Previously in logstash.config file I was providing my elastic cloud console credentials where the email address was getting encoded twice . So I entered the elastic search rest credentials instead . I am able to connect to the same Elastic Search instance through CURL and High Level Rest Client. But the problem is with Logstash . I am also able to connect Logstash to my Elastic Server on localhost but the issue still persists on connecting it to instance on Elastic Cloud.

Ahh ok. This is not your Cloud login.

When you create a new cluster you would have been given an elastic user and a password for that. That is what you need to use. If you didn't write that down then check out https://www.elastic.co/guide/en/cloud/current/ec-password-reset.html.

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