# Elasticsearch ServiceのES エンドポイントURLへのリクエストについて

**URL:** <https://discuss.elastic.co/t/elasticsearch-service-es-url/199810>\
**Category:** 日本語による質問・議論はこちら\
**Created:** [September 17, 2019, 11:01am UTC](https://discuss.elastic.co/t/elasticsearch-service-es-url/199810 "2019-09-17T11:01:41Z")\
**Posts on this page:** 3\
**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:** [September 17, 2019, 11:01am UTC](https://discuss.elastic.co/t/elasticsearch-service-es-url/199810/1 "2019-09-17T11:01:41Z")

</div>

index作成時に以下のような形でjsonを送信しようと思っているのですが、  
ユーザ名やパスワード(もしくはCloud ID等)はどこに含めればよいのでしょうか？  
LogstashやKibanaのコンソールからではなく、自作のプログラムからElasticsearch Service上に作成したインスタンスへのエンドポイントへリクエストする形で作成・データ投入を行えればと思っております。

> request.put({  
> url: `${this.esUrl + '/' + indexName}`,  
> headers: {  
> 'Content-type': 'application/json',  
> },  
> json: {  
> settings: {  
> analysis: {  
> analyzer: {  
> my\_kuromoji\_analyzer: {  
> type: 'custom',  
> tokenizer: 'ja\_tokenizer',  
> },  
> },  
> tokenizer: {  
> ja\_tokenizer: {  
> type: 'kuromoji\_tokenizer',  
> mode: 'normal',  
> },  
> },  
> },  
> },  
> mappings: {  
> data: {  
> properties: this.esMappings,  
> },  
> },  
> },  
> })

---

<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:** [September 17, 2019, 12:41pm UTC](https://discuss.elastic.co/t/elasticsearch-service-es-url/199810/2 "2019-09-17T12:41:52Z")

</div>

リクエストURLの中にユーザ名、パスワードを含めることができます。

例えば、以下のような条件であったとします。

- ユーザ名： elastic
- パスワード：asdf1234
- Elasticsearch Service Endpoint： `https://123456789.eastus2.azure.elastic-cloud.com:9243`

認証情報を含めるには、こうすればできます。

[https://elastic:asdf1234@123456789.eastus2.azure.elastic-cloud.com:9243](https://elastic:asdf1234@123456789.eastus2.azure.elastic-cloud.com:9243)  
([https://ユーザ名](https://xn--wck1eucs30q):パスワード＠ホスト名:9243）

お試しください。

なお、蛇足ながら派生した新しい質問の場合は、新しい投稿として頂くほうが良いかと思います。  
そのほうが、後から検索してここにたどり着いた人にとってわかりやすいかと。

---

<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:** [October 15, 2019, 12:41pm UTC](https://discuss.elastic.co/t/elasticsearch-service-es-url/199810/3 "2019-10-15T12:41:55Z")

</div>

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