# JMX input plugin usage

**URL:** https://discuss.elastic.co/t/jmx-input-plugin-usage/116795
**Category:** Logstash
**Created:** [January 24, 2018, 4:35am UTC](https://discuss.elastic.co/t/jmx-input-plugin-usage/116795 "2018-01-24T04:35:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![naveen\_K.N](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@naveen\_K.N](https://discuss.elastic.co/u/naveen_K.N)
#### Post date: [January 24, 2018, 4:35am UTC](https://discuss.elastic.co/t/jmx-input-plugin-usage/116795/1 "2018-01-24T04:35:39Z")

</div>

Hi Everyone,  
im using Logstash's JMX Plugin to get JVM metrics of server, where i enabled JMX port and Remote connection access. i created JVM-Monoitoring.conf config file as follows:  
input  
{  
jmx{  
path =\> "C:\Users\nakn\Downloads\logstash-6.1.1\config\jmx"  
polling\_frequency =\> 60  
nb\_thread =\> 4  
type =\> jmx  
}  
}  
filter  
{  
it [type] == "jmx" {  
if ("Memory.HeapMemoryUsage" in [metric\_path] or "Memory.NonHeapMemoryUsage" in [metric\_path]) {  
ruby {  
code =\> "event['memoryUsage'] = event['metric\_value\_number'] \* 100"  
add\_tag =\> ["memoryUsage"]  
}  
}  
}  
}  
output  
{  
stdout { codec =\> rubydebug }  
elasticsearch  
{  
hosts =\> "localhost:9200"  
index =\> "jmxanalysis"  
}  
}

within specified path of input section, i have json config to specify which host,port and metrics to retrieve as follows:  
{  
"host":"service:jmx:rmi://localhost/jndi/rmi://localhost:8075/jmxrmi",  
"port":8075,  
"alias":"defaultJmx",  
"queries":[  
{  
"object\_name":"java.lang:type=Memory",  
"object\_alias":"Memory"  
},  
{  
"object\_name":"java.lang:type=Runtime",  
"attributes":[  
"Uptime",  
"StartTime"  
],  
"object\_alias":"Runtime"  
}  
]  
}//end of file

i dont know why JMX is not able to get data from JMX port?? i tried running logstash from command prompt as " logstash -f JVM-Monitoring.conf ", logstash is getting started but at the end it is terminating without displaying data!!

Thanks and regards,  
NAveena K N

---

<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: [February 21, 2018, 4:35am UTC](https://discuss.elastic.co/t/jmx-input-plugin-usage/116795/2 "2018-02-21T04:35:57Z")

</div>

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