Using Elastic Cloud

Logstash comes with two settings that simplify using modules with Elastic Cloud.The Elasticsearch and Kibana hostnames in Elastic Cloud may be hard to setin the Logstash config or on the commandline, so a Cloud ID can be used instead.

Note

Cloud ID applies only when a Logstash module is enabled, otherwisespecifying Cloud ID has no effect. Cloud ID applies to data that gets sent viathe module, to runtime metrics sent via X-Pack monitoring, and to the endpointused by X-Pack central management features of Logstash, unless explicitoverrides to X-Pack settings are specified in logstash.yml.

Cloud ID

The Cloud ID, which can be found in the Elastic Cloud web console, is used byLogstash to build the Elasticsearch and Kibana hosts settings.It is a base64 encoded text value of about 120 characters made up of upper andlower case letters and numbers.If you have several Cloud IDs, you can add a label, which is ignoredinternally, to help you tell them apart. To add a label you should prefix yourCloud ID with a label and a : separator in this format "<label>:<cloud-id>"

cloud.id will overwrite these settings:

var.elasticsearch.hostsvar.kibana.host

Cloud Auth

This is optional. Construct this value by following this format "<username>:<password>".Use your Cloud username for the first part. Use your Cloud password for the second part,which is given once in the Cloud UI when you create a cluster.As your Cloud password is changeable, if you change it in the Cloud UI remember to change it here too.

cloud.auth when specified will overwrite these settings:

var.elasticsearch.usernamevar.elasticsearch.passwordvar.kibana.usernamevar.kibana.password

Example:

These settings can be specified in the logstash.yml settings file.They should be added separately from any module configuration settings you may have added before.

# example with a labelcloud.id: "staging:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy"cloud.auth: "elastic:YOUR_PASSWORD"
# example without a labelcloud.id: "dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy"cloud.auth: "elastic:YOUR_PASSWORD"

These settings can be also specified at the command line, like this:

bin/logstash --modules netflow -M "netflow.var.input.udp.port=3555" --cloud.id <cloud-id> --cloud.auth <cloud.auth>