# Logstash into another different cluster?

**URL:** https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975
**Category:** Logstash
**Created:** [September 20, 2016, 7:19am UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975 "2016-09-20T07:19:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Allie\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allie_yang/32/16538_2.png) [@Allie\_Yang](https://discuss.elastic.co/u/Allie_Yang)
#### Post date: [September 20, 2016, 7:19am UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/1 "2016-09-20T07:19:09Z")

</div>

Hi How could i export data from logstash to another ES cluster, which i never used before?  
It is just i need to logstash the data from my local logstash to my team's ES Cluster, rather than my own test ES cluster...

I changed the **cluster name** already to the new cluster name in _elasticsearch.yml_. But my previous cluster still gets data...Anything else i shall do?  
Any suggestion pls?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 20, 2016, 8:07pm UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/2 "2016-09-20T20:07:53Z")

</div>

Change the Elasticsearch hostname in the elasticsearch output to one or more of the hosts in the cluster you want to send to. This has nothing to do with elasticsearch.yml.

---

<div class="post-metadata">

### Author: ![Allie\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allie_yang/32/16538_2.png) [@Allie\_Yang](https://discuss.elastic.co/u/Allie_Yang)
#### Post date: [September 20, 2016, 8:09pm UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/3 "2016-09-20T20:09:56Z")

</div>

i don't understand. The host is still with ES with port 9200 and host 127.0.0.1. It is just another ES cluster.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 21, 2016, 5:27am UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/4 "2016-09-21T05:27:07Z")

</div>

If the host and port are the same and you've just renamed the cluster you don't have to do anything. Logstash's elasticsearch output doesn't care about the cluster name set in elasticsearch.yml.

If you want to send to a different cluster (and not the same cluster that has been renamed) the host and/or port _must_ change. Two ES clusters can't listen on the same host:port combination.

---

<div class="post-metadata">

### Author: ![Allie\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allie_yang/32/16538_2.png) [@Allie\_Yang](https://discuss.elastic.co/u/Allie_Yang)
#### Post date: [September 22, 2016, 10:59pm UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/5 "2016-09-22T22:59:32Z")

</div>

Yea it is the 2nd situation.

My solution somehow works: I only changed the cluster name in the elasticsearch yml files. It works the second day, not immediately. i haven't switched back yet, not sure if there will be problem.

For your solution, to change the port or/and host, how can i do that? I think port 9200 is a fixed value for ES, and host value should also be the same value for everyone...?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 23, 2016, 6:09am UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/6 "2016-09-23T06:09:49Z")

</div>

Let me put it this way: You should point Logstash to the host and port of one or more of your Elasticsearch nodes. Period. Logstash doesn't care about the name of the cluster.

---

<div class="post-metadata">

### Author: ![Allie\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allie_yang/32/16538_2.png) [@Allie\_Yang](https://discuss.elastic.co/u/Allie_Yang)
#### Post date: [September 23, 2016, 5:47pm UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/7 "2016-09-23T17:47:19Z")

</div>

How can I change the port or/and host name? Are they not fixed as 9200 and 127.0.0.1? (All clusters are ES)

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 25, 2016, 7:13pm UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/8 "2016-09-25T19:13:56Z")

</div>

The HTTP port that Elasticsearch listens to is controlled by the http.port configuration setting. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html).

The hostname that ES listens to is obviously controlled by the host that it runs on, but if your server has multiple network interfaces you can select one of them if you don't want ES to be accessible on all interfaces. The default is indeed 127.0.0.1, and with that setting ES is of course not accessible from other hosts.

---

<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: [July 6, 2017, 4:37am UTC](https://discuss.elastic.co/t/logstash-into-another-different-cluster/60975/9 "2017-07-06T04:37:05Z")

</div>


