# Single jmx configuration json file possible for multiple servers to connect to logstash

**URL:** <https://discuss.elastic.co/t/single-jmx-configuration-json-file-possible-for-multiple-servers-to-connect-to-logstash/231660>\
**Category:** Logstash\
**Created:** [May 8, 2020, 4:50am UTC](https://discuss.elastic.co/t/single-jmx-configuration-json-file-possible-for-multiple-servers-to-connect-to-logstash/231660 "2020-05-08T04:50:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhanu\_Praveen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhanu_praveen/32/60395_2.png) [@Bhanu\_Praveen](https://discuss.elastic.co/u/Bhanu_Praveen)\
**Post date:** [May 8, 2020, 4:50am UTC](https://discuss.elastic.co/t/single-jmx-configuration-json-file-possible-for-multiple-servers-to-connect-to-logstash/231660/1 "2020-05-08T04:50:36Z")

</div>

Hello,

Currently i have configured single jmx json file for a single server in logstash jmx input configuration as below.

[{  
"host" : "localhost" ,  
"port" : 9000,  
"alias" : "jmx.elasticsearch" ,  
"queries" : [  
{  
"object\_name" : "java.lang:type=Memory" ,  
"object\_alias" : "Memory"  
}]

Is it possible to add more hosts and ports in the same json file?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 8, 2020, 12:47pm UTC](https://discuss.elastic.co/t/single-jmx-configuration-json-file-possible-for-multiple-servers-to-connect-to-logstash/231660/2 "2020-05-08T12:47:51Z")

</div>

> [@Bhanu\_Praveen](#):
>
> Is it possible to add more hosts and ports in the same json file?

No. The path option on a jmx input points to a directory. Each file in the directory describes the metrics that should be fetched from a single JVM. You need one file per JVM.

---

<div class="post-metadata">

**Author:** ![Bhanu\_Praveen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhanu_praveen/32/60395_2.png) [@Bhanu\_Praveen](https://discuss.elastic.co/u/Bhanu_Praveen)\
**Post date:** [May 11, 2020, 2:48am UTC](https://discuss.elastic.co/t/single-jmx-configuration-json-file-possible-for-multiple-servers-to-connect-to-logstash/231660/3 "2020-05-11T02:48:15Z")

</div>

Thank You. Is there any better alternative for Jmx then logstash input which is used for distributed servers?

---

<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:** [June 8, 2020, 2:48am UTC](https://discuss.elastic.co/t/single-jmx-configuration-json-file-possible-for-multiple-servers-to-connect-to-logstash/231660/4 "2020-06-08T02:48:28Z")

</div>

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