# logstashとElasticsearch Serviceの連携について

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-service/206027>\
**Category:** 日本語による質問・議論はこちら\
**Created:** [October 31, 2019, 11:07am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-service/206027 "2019-10-31T11:07:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tsgkdt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsgkdt/32/39151_2.png) [@tsgkdt](https://discuss.elastic.co/u/tsgkdt)\
**Post date:** [October 31, 2019, 1:29pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-service/206027/2 "2019-10-31T13:29:56Z")

</div>

outputのelasticsearcにhosts、ユーザ名、パスワードを指定しておくのが良いと思います。

```auto
output {
    
    elasticsearch {
        hosts => ["https://123456789asdfhujiko.eastus2.azure.elastic-cloud.com:9243"]
        user => "elastic"
        password => "tadashiipassword"
    }

}

```

> [@How to define cloud id in logstash config file?](https://discuss.elastic.co/t/how-to-define-cloud-id-in-logstash-config-file/135584/2):
>
> Will this "data-out.conf" find the cloud ES instance by checking against main "logstash.conf"? I assume you mean .yml, not .conf ? (if so...) The Elasticsearch settings in logstash.yml are only applicable to monitoring, management, and modules. You still have to define your hosts (and credentials if needed) in the output { section of your configuration [1]. If have 1 instance/cluster of Elasticsearch , it does become a bit redundant to redefine the same connection everywhere. Also note, the…

こちらのElasticメンバーの回答をみると、cloud.idやauthは、モニタリングやモジュール用であって、outputには直接hostを書いてね、と書いてあるように見えるからです。

> you will need to use the host name(s) directly.

ご参考になれば幸いです。

---

_[View the full topic](https://discuss.elastic.co/t/logstash-elasticsearch-service/206027)._
