401 Authorization Error with logstash elastic cloud module

Official logstash elastic cloud module

Official doc for starting with

My logstash.yml looks like:

# ------------ Cloud Settings ---------------
# Define Elastic Cloud settings here.
# Format of cloud.id is a base64 value e.g. dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy
# and it may have an label prefix e.g. staging:dXMtZ...
# This will overwrite 'var.elasticsearch.hosts' and 'var.kibana.host'
# cloud.id: <identifier>
  cloud.id: "Test:testkey"
#
# Format of cloud.auth is: <user>:<pass>
# This is optional
# If supplied this will overwrite 'var.elasticsearch.username' and 'var.elasticsearch.password'
# If supplied this will overwrite 'var.kibana.username' and 'var.kibana.password'
# cloud.auth: elastic:<password>
  cloud.auth: "elastic:password"

This is all I have in logstash.yml and nothing else,

And I am getting:

[2018-08-29T12:33:52,112][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"https://myserverurl:12345/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'https://myserverurl:12345/'"}

And the config looks like:

input{jdbc{...jdbc here... This works, as I see data in windows console}}
output {
    stdout { codec => json_lines }
    elasticsearch {
    hosts => ["myserverurl:12345"]
    index => "my_index"
    # document_id => "%{brand}"
    }

What I am doing is bin/logstash on windows,
It loads data from database that I have configured in input of conf file and then shows me error, I want to index my data from MySQL to elasticsearch on Cloud, I took 14 days trial and created a test index, for learning purpose as I later have to deploy it.
My Pipeline looks like:

  - pipeline.id: my_id
    path.config: "./config/conf_file_name.conf"
    pipeline.workers: 1

If logs won't include senistive data, I can also provide them.

Configure logstash config file docs
The output shall include
elasticsearch {
hosts => ["https://host:port/"]
user => "elastic"
password => "password"
# protocol => https
# port => "port"
index => "test_index"
# document_id => "%{id}"

When I already have specified my password in settings file, why do I again need to specify it in every config file?

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