# 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:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masanori\_Mishima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/masanori_mishima/32/45030_2.png) [@Masanori\_Mishima](https://discuss.elastic.co/u/Masanori_Mishima)\
**Post date:** [October 31, 2019, 11:07am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-service/206027/1 "2019-10-31T11:07:30Z")

</div>

logstashを使用してElasticsearch Service上のdeploymentに対して  
indexの作成や更新等を行いたいと考えています。  
docker等でサーバを立ててlogstashのイメージをpullしてきた場合、logstashからindexをElasticsearch Service上のdeploymentへ流し込む際の指定はlogstash.yml上にCloud IDとUser ID、PWだけでよいのでしょうか。  
Elasticsearchのendpoint URLの指定は特に必要ないのでしょうか。  
logstashとElasticsearch Serivice上のdeploymentでどのように疎通を行うのでしょうか。

---

<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.

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

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [October 31, 2019, 2:33pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-service/206027/3 "2019-10-31T14:33:32Z")

</div>

こちらに対応するべきってIssueが作られてますねー。

> <https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/893>
>
> Currently, only core features of logstash like monitoring support the configuration of cloud id.
> I'd be nice if elastic cloud users can...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 28, 2019, 2:33pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-service/206027/4 "2019-11-28T14:33:47Z")

</div>

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