Multiple hosts output


(elastic-fan) #1

Hi,
i have a local ES and also elastic cloud ES, the local ES dont have uid and pwd where as the elastic cloud ES has , how can i specify this in logstash output
output {
if [type] == "output" {
elasticsearch {
hosts => ["127.0.0.1:9200","EScloudurl"]
index => "metrics-%{+YYYY.MM.dd}"
}
}
}

how can i specify the username and password here.


(Christian Dahlqvist) #2

If you want to send to two different clusters you will need to use two separate output blocks.


(elastic-fan) #3

can u give me some examples please


(Christian Dahlqvist) #4

Something like this would allow to to manage settings for each output:

output {
  if [type] == "output" {
    elasticsearch {
      hosts => ["127.0.0.1:9200"]
      index => "metrics-%{+YYYY.MM.dd}"
    }

    elasticsearch {
      hosts => ["EScloudurl"]
      index => "metrics-%{+YYYY.MM.dd}"
    }
  }
}

(elastic-fan) #5

elastic cloud has https es url how can i use it here?


(elastic-fan) #6

what we have to do to connect to https ES elastic cloud with authentication


(Christian Dahlqvist) #7

Use the full https URL in hosts and specify user and password parameters as described in the documentation.


(system) #8

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