# How to put multiple hosts in one jmx conf file?

**URL:** <https://discuss.elastic.co/t/how-to-put-multiple-hosts-in-one-jmx-conf-file/173061>\
**Category:** Logstash\
**Created:** [March 19, 2019, 11:03pm UTC](https://discuss.elastic.co/t/how-to-put-multiple-hosts-in-one-jmx-conf-file/173061 "2019-03-19T23:03:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Lu](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Stephen\_Lu](https://discuss.elastic.co/u/Stephen_Lu)\
**Post date:** [March 19, 2019, 11:03pm UTC](https://discuss.elastic.co/t/how-to-put-multiple-hosts-in-one-jmx-conf-file/173061/1 "2019-03-19T23:03:55Z")

</div>

I have a jmx input, with below jmx conf file:  
{  
"host" : "hostname",  
"port" : port,

```
    "queries" : [
            {
                    "object_name" : "java.lang:type=Memory",
                    "object_alias" : "Memory"
            },
            {
                    "object_name" : "java.lang:type=OperatingSystem",
                    "object_alias" : "OS"
            },
            {
                    "object_name" : "java.lang:type=Runtime",
                    "object_alias" : "Runtime"
            },
            {
                    "object_name" : "java.lang:type=Threading",
                    "object_alias" : "Threading"
            }
    ]

```

}  
I need collect from dozens of servers. Instead of creating dozens of conf files for each JVM, is there any better way to put multiple hosts in one conf file? Like:

hosts =\> ["host1", "host2", "host3"]

---

<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:** [April 16, 2019, 11:03pm UTC](https://discuss.elastic.co/t/how-to-put-multiple-hosts-in-one-jmx-conf-file/173061/2 "2019-04-16T23:03:56Z")

</div>

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