# Support for multiple elasticsearch server configuration in apm server yml file

**URL:** <https://discuss.elastic.co/t/support-for-multiple-elasticsearch-server-configuration-in-apm-server-yml-file/240311>\
**Category:** APM\
**Tags:** server\
**Created:** [July 8, 2020, 9:18am UTC](https://discuss.elastic.co/t/support-for-multiple-elasticsearch-server-configuration-in-apm-server-yml-file/240311 "2020-07-08T09:18:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bimanarajesh](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@bimanarajesh](https://discuss.elastic.co/u/bimanarajesh)\
**Post date:** [July 8, 2020, 9:18am UTC](https://discuss.elastic.co/t/support-for-multiple-elasticsearch-server-configuration-in-apm-server-yml-file/240311/1 "2020-07-08T09:18:37Z")

</div>

**Elasticsearch version** :  
6.8.4  
**APM Server version** :  
7.6.0  
**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
Download page  
**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.  
No  
**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
Does the APM server support multiple elasticsearch IPs configurations in apm-server.yml file so that we can send documents to different elasticsearch servers based on indices conditions.

use-case:  
I have created two different elasticsearch servers and i need to send data to each elasticsearch server based on indices conditions.

apm-server:  
host: 0.0.0.0:8200  
output.elasticsearch:  
hosts:

- 172.31.90.133:9200  
indices:
- index: apm-stacktrace-sj5cm67x\_write  
when.contains:  
labels.\_tag\_profileName: nodejs
- index: apm-stacktrace-1bsdmimn\_write  
when.contains:  
labels.\_tag\_profileName: trace  
password: '123456'  
username: apm  
setup.template.enabled: false

In case this support is not available, will it be available in future. Please let us know.

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [July 9, 2020, 11:43am UTC](https://discuss.elastic.co/t/support-for-multiple-elasticsearch-server-configuration-in-apm-server-yml-file/240311/2 "2020-07-09T11:43:45Z")

</div>

Hi @bimanarajesh,  
this is not possible when writing directly from APM Server to Elasticsearch.  
For a more complicated routing you can configure the [logstash output](https://www.elastic.co/guide/en/apm/server/current/logstash-output.html) in the `apm-server.yml` and then create a logstash pipeline for the [Elasticsearch output](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html).

---

<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 30, 2020, 7:43am UTC](https://discuss.elastic.co/t/support-for-multiple-elasticsearch-server-configuration-in-apm-server-yml-file/240311/3 "2020-07-30T07:43:45Z")

</div>

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