# How to transfer data to a host with a username and password

**URL:** <https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161>\
**Category:** Logstash\
**Created:** [September 2, 2021, 11:15am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161 "2021-09-02T11:15:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [September 2, 2021, 11:15am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/1 "2021-09-02T11:15:13Z")

</div>

Hello dear friends. I have a problem. I have been helped by this website in many ways before. First of all, thank you very much for all the help for helping me improve myself on elasticsearch. 🙂 Current problem is that I want to transfer some data to a host with a username and password, but I keep getting the same error message. I would be very happy if you help. 🙂

My conf file:

```auto
input { 
   file { 
      path => "........../*.txt"
      start_position => "beginning"
      sincedb_path => "NUL" 
   }
}
filter {
............. 
}
output {
    elasticsearch { 
      hosts => "xx.xx.xxx.xxx:xxxx" 
      manage_template => false 
      index => "my_index_name"
      document_type => "my_index_name" 
      user => "my_user_name"
      password => "my_password" 
    }

```

Error message:

> [WARN][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error {:url=\>"[http://elastic\_user\_name:xxxxxx@xx.xx.xxx.xxx](http://elastic_user_name:xxxxxx@xx.xx.xxx.xxx):xxxx/", :exception=\>LogStash::Outputs::Elasticsearch::HttpClient::Pool::BadResponseCodeError, :message=\>"Got response code '403' contacting Elasticsearch at URL '[http://xx.xx.xxx.xxx](http://xx.xx.xxx.xxx):xxxx/'"}

I also made changes to logstash.yml and elasticsearch.yml files as follows, but I got the same error.

> elasticsearch.yml:  
> xpack.management.elasticsearch.username: my\_elastic\_user\_name  
> xpack.management.elasticsearch.password: my\_password

> logstash.yml:  
> xpack.monitoring.elasticsearch.username: my\_elastic\_user\_name  
> xpack.monitoring.elasticsearch.password: my\_password

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 3, 2021, 4:29am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/2 "2021-09-03T04:29:10Z")

</div>

Can you curl Elasticsearch using the username and password that you have in your Logstash config?

> [@Busra\_Duygu](#):
>
> ```auto
> document_type => "my_index_name" 
> 
> ```

You should remove that, it's deprecated.

---

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [September 3, 2021, 5:33am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/3 "2021-09-03T05:33:07Z")

</div>

Ok i removed the document\_type but i don't understand your this sentence:

> Can you curl Elasticsearch using the username and password that you have in your 'ls config?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 3, 2021, 5:35am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/4 "2021-09-03T05:35:26Z")

</div>

Can you check that the user name and password work directly with Elasticsearch?

---

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [September 3, 2021, 6:34am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/5 "2021-09-03T06:34:07Z")

</div>

I was able to connect to elasticsearch with the my custom port and host I wanted, but I was using localhost:5601 by default in kiban. Now i want to open kiban using its own host and port. I made some changes in kibana.yml file for this, but I can't access kibana. Can you help me about this problem?

My changes in kibana.yml file:

> server.port: xxxx  
> server.host: "xx.xx.xxx.xxx"  
> server.name: "my\_server\_name"  
> elasticsearch.hosts: ["[http://xx.xx.xxx.xxx](http://xx.xx.xxx.xxx):xxxx"]  
> elasticsearch.username: "my\_user\_name"  
> elasticsearch.password: "my\_password"

---

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [September 3, 2021, 8:14am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/6 "2021-09-03T08:14:55Z")

</div>

@warkolm Maybe this problem can be solved by sending request from kibana to remote server but when i run this queries it also gave error.

```auto
GET https://xx.xx.xxx.xxx/my_index_name/_search
{
   "query": {
       "match_all": {}
    }
}

```

or

```auto
GET xx.xx.xxx.xxx/my_index_name/_search
{
   "query": {
       "match_all": {}
    }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 3, 2021, 8:16am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/7 "2021-09-03T08:16:56Z")

</div>

> [@Busra\_Duygu](#):
>
> My changes in kibana.yml file:

Right, but unless you show those changes then there's pretty much nothing we can do except look at X's.

---

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [September 3, 2021, 8:57am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/8 "2021-09-03T08:57:08Z")

</div>

@warkolm I mean for example host:192.150.01.25 port:5625

---

<div class="post-metadata">

**Author:** ![Busra\_Duygu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/busra_duygu/32/90462_2.png) [@Busra\_Duygu](https://discuss.elastic.co/u/Busra_Duygu)\
**Post date:** [September 3, 2021, 11:05am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/9 "2021-09-03T11:05:13Z")

</div>

I'm sorry you can't help me without telling me what the error is, you're right.

```auto
#! [types removal] Specifying types in search requests is deprecated.
{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_not_found_exception",
        "reason" : "no such index [xx.xx.xxx.xxx]",
        "resource.type" : "index_or_alias",
        "resource.id" : "xx.xx.xxx.xxx",
        "index_uuid" : "_na_",
        "index" : "xx.xx.xxx.xxx"
      }
    ],
    "type" : "index_not_found_exception",
    "reason" : "no such index [xx.xx.xxx.xxx]",
    "resource.type" : "index_or_alias",
    "resource.id" : "xx.xx.xxx.xxx",
    "index_uuid" : "_na_",
    "index" : "xx.xx.xxx.xxx"
  },
  "status" : 404
}

```

---

<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 1, 2021, 11:05am UTC](https://discuss.elastic.co/t/how-to-transfer-data-to-a-host-with-a-username-and-password/283161/10 "2021-10-01T11:05:44Z")

</div>

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