# Jmx metrics using logstash jmx input plugin

**URL:** https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889
**Category:** Logstash
**Created:** [June 9, 2019, 6:29pm UTC](https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889 "2019-06-09T18:29:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![460](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@460](https://discuss.elastic.co/u/460)
#### Post date: [June 9, 2019, 6:29pm UTC](https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889/1 "2019-06-09T18:29:20Z")

</div>

Hello team  
I have installed jmx plugin to logstash 6.6.2  
How do this plugin work. When I start the logstash with jmx input and jmx config as the input file.....It is giving an error....no such file or directory found.

Input  
{  
jmx {  
//Required  
path =\> "/apps/logstash\_conf/jmxconf"  
//Optional, default 60s  
polling\_frequency =\> 15  
type =\> "jmx"  
//Optional, default 4  
nb\_thread =\> 4  
}  
}  
Output  
{  
elasticsearch {  
host......  
Index..  
}

}

Jmx conf file

{  
//Required, JMX listening host/ip  
"host" : "192.168.1.2",  
//Required, JMX listening port  
"port" : 1335,  
//Optional, the username to connect to JMX  
"username" : "user",  
//Optional, the password to connect to JMX  
"password": "pass",  
//Optional, use this alias as a prefix in the metric name. If not set use \_  
"alias" : "test.homeserver.elasticsearch",  
//Required, list of JMX metrics to retrieve  
"queries" : [  
{  
//Required, the object name of Mbean to request  
"object\_name" : "java.lang:type=Memory",  
//Optional, use this alias in the metrics value instead of the object\_name  
"object\_alias" : "Memory"  
}, {  
"object\_name" : "java.lang:type=Runtime",  
//Optional, set of attributes to retrieve. If not set retrieve  
//all metrics available on the configured object\_name.  
"attributes" : ["Uptime", "StartTime"],  
"object\_alias" : "Runtime"  
}, {  
//object\_name can be configured with \* to retrieve all matching Mbeans  
"object\_name" : "java.lang:type=GarbageCollector,name=_",  
"attributes" : ["CollectionCount", "CollectionTime"],  
//object\_alias can be based on specific value from the object\_name thanks to {\<varname\>}. //In this case {type} will be replaced by GarbageCollector...  
"object\_alias" : "{type}.{name}"  
}, {  
"object\_name" : "java.nio:type=BufferPool,name=_",  
"object\_alias" : "{type}.{name}"  
} ]  
}

Can u please help me out .....  
About how this works and wt should given in the host and port fields of jmx config.  
And where should the jmx config file be placed

---

<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: [June 9, 2019, 11:58pm UTC](https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889/2 "2019-06-09T23:58:20Z")

</div>

What exactly is the error message that you get? Please include the stack trace.

---

<div class="post-metadata">

### Author: ![460](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@460](https://discuss.elastic.co/u/460)
#### Post date: [June 10, 2019, 7:32am UTC](https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889/3 "2019-06-10T07:32:11Z")

</div>

HI Badger,

Thanks for the reply.

This is the error which I am getting

* * *

Sending Logstash logs to C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/logs which is now configured via log4j2.properties  
[2019-06-06T17:42:27,171][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2019-06-06T17:42:27,191][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"6.6.2"}  
[2019-06-06T17:42:34,154][INFO][logstash.pipeline] Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>4, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50}  
[2019-06-06T17:42:34,549][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>, :added=\>[[http://elastic:xxxxxx@10.51.22.121:9200/](http://elastic:xxxxxx@10.51.22.121:9200/)]}}  
[2019-06-06T17:42:34,809][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>"[http://elastic:xxxxxx@10.51.22.121:9200/](http://elastic:xxxxxx@10.51.22.121:9200/)"}  
[2019-06-06T17:42:34,916][INFO][logstash.outputs.elasticsearch] ES Output version determined {:es\_version=\>6}  
[2019-06-06T17:42:34,921][WARN][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>6}  
[2019-06-06T17:42:34,947][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[http://10.51.22.121:9200](http://10.51.22.121:9200)"]}  
[2019-06-06T17:42:34,954][INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=\>nil}  
[2019-06-06T17:42:34,976][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage\_template=\>{"template"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s"}, "mappings"=\>{"default"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}}  
[2019-06-06T17:42:35,095][INFO][logstash.inputs.jmx] Create queue dispatching JMX requests to threads  
[2019-06-06T17:42:35,097][INFO][logstash.inputs.jmx] Compile regexp for group alias object replacement  
[2019-06-06T17:42:35,120][INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0xc7a2c5f run\>"}  
[2019-06-06T17:42:35,123][INFO][logstash.inputs.jmx] Initialize 4 threads for JMX metrics collection  
[2019-06-06T17:42:35,160][INFO][logstash.inputs.jmx] Loading configuration files in path {:path=\>"C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/jmx.json"}  
[2019-06-06T17:42:35,164][ERROR][logstash.inputs.jmx] No such file or directory - No such directory: C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/jmx.json  
[2019-06-06T17:42:35,166][ERROR][logstash.inputs.jmx] org/jruby/RubyDir.java:146:in `initialize' org/jruby/RubyDir.java:383:in`foreach'  
C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/logstash-input-jmx-3.0.7/lib/logstash/inputs/jmx.rb:335:in `run' C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/logstash-core/lib/logstash/pipeline.rb:426:in`inputworker'  
C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/logstash-core/lib/logstash/pipeline.rb:420:in `block in start\_input'  
[2019-06-06T17:42:35,182][INFO][logstash.agent] Pipelines running {:count=\>1, :running\_pipelines=\>[:main], :non\_running\_pipelines=\>}  
[2019-06-06T17:42:35,468][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2019-06-06T17:42:35,975][INFO][logstash.pipeline] Pipeline has terminated {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0xc7a2c5f run\>"}

* * *

Regards,  
Likhith

---

<div class="post-metadata">

### Author: ![lovelash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lovelash/32/46023_2.png) [@lovelash](https://discuss.elastic.co/u/lovelash)
#### Post date: [June 10, 2019, 7:47am UTC](https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889/4 "2019-06-10T07:47:20Z")

</div>

Even I am getting the same error. Any solution for the same.

Regards,  
[Get-Shareit.com](https://get-shareit.com) [Authorityapk.com](https://authorityapk.com)

---

<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: [June 10, 2019, 12:55pm UTC](https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889/5 "2019-06-10T12:55:30Z")

</div>

> [@460](#):
>
> [2019-06-06T17:42:35,160][INFO][logstash.inputs.jmx] Loading configuration files in path {:path=\>"C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/jmx.json"}  
> [2019-06-06T17:42:35,164][ERROR][logstash.inputs.jmx] No such file or directory - No such directory: C:/Users/lpathuri/Downloads/ELK-6.6.2/logstash-6.6.2/jmx.json

I am unable to understand why it would be looking for that file given the configuration you claim to be running.

---

<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 8, 2019, 12:55pm UTC](https://discuss.elastic.co/t/jmx-metrics-using-logstash-jmx-input-plugin/184889/6 "2019-07-08T12:55:32Z")

</div>

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