I have install jmx inpuut and make a jboss configuration file in logstash as follow:
input {
jmx{
path => "/home/lau/Downloads/logstash/jmx"
polling_frequency => 30
type => "jmx"
nb_thread => 4
}
}
output {
elasticsearch { hosts => slocalhost }
}
Then, inside /home/lau/Downloads/logstash/jmx, I have another jmx.conf file as the follow
{
"url" : "service:jmx:remoting-jmx://localhost:9999",
"username" : "jboss",
"password": "123456",
"alias" : "jmx.instance1.elasticsearch",
"host" : "localhost",
"port" : 9999,
"queries" : [
{
"object_name" : "java.lang:type=Memory",
"attributes" : [ "HeapMemoryUsage", "NonHeapMemoryUsage" ],
"object_alias" : "Memory"
}, {
"object_name" : "java.lang:type=Runtime",
"attributes" : [ "Uptime", "StartTime" ],
"object_alias" : "Runtime"
}, {
"object_name" : "java.lang:type=Threading",
"attributes" : [ "ThreadCount", "TotalStartedThreadCount", "DaemonThreadCount", "PeakThreadCount" ],
"object_alias" : "Threading"
}, {
"object_name" : "java.lang:type=OperatingSystem",
"attributes" : [ "OpenFileDescriptorCount", "FreePhysicalMemorySize", "CommittedVirtualMemorySize", "FreeSwapSpaceSize", "ProcessCpuLoad", "ProcessCpuTime", "SystemCpuLoad", "TotalPhysicalMemorySize", "TotalSwapSpaceSize", "SystemLoadAverage" ],
"object_alias" : "OperatingSystem"
} ]
}
When I run the logstash conf file, it gives me the following result:
Create queue dispatching JMX requests to threads {:level=>:info}
Compile regexp for group alias object replacement {:level=>:info}
Initialize 4 threads for JMX metrics collection {:level=>:info}
Loading configuration files in path {:path=>"/home/lau/Downloads/logstash/jmx", :level=>:info}
Issue with configuration file {:file=>"/home/lau/Downloads/logstash/jmx/jmx.conf~", :validation_errors=>["Bad type for parameter 'port', expecting 'Fixnum', found 'String'."], :level=>:warn}
Unsupported protocol: remoting-jmx {:level=>:error}
javax.management.remote.JMXConnectorFactory.newJMXConnector(javax/management/remote/JMXConnectorFactory.java:357)
javax.management.remote.JMXConnectorFactory.connect(javax/management/remote/JMXConnectorFactory.java:267)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
RUBY.create_connection(/home/lau/Downloads/logstash/vendor/bundle/jruby/1.9/gems/jmx4r-0.1.4/lib/jmx4r.rb:221)
RUBY.connection(/home/lau/Downloads/logstash/vendor/bundle/jruby/1.9/gems/jmx4r-0.1.4/lib/jmx4r.rb:138)
RUBY.thread_jmx(/home/lau/Downloads/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jmx-2.0.4/lib/logstash/inputs/jmx.rb:210)
RUBY.run(/home/lau/Downloads/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jmx-2.0.4/lib/logstash/inputs/jmx.rb:321)
java.lang.Thread.run(java/lang/Thread.java:745) {:level=>:error}
Using mapping template from {:path=>nil, :level=>:info}
Attempting to install template {:manage_template=>{"template"=>"logstash-*", "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"_all"=>{"enabled"=>true, "omit_norms"=>true}, "dynamic_templates"=>[{"message_field"=>{"match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"string", "index"=>"analyzed", "omit_norms"=>true, "fielddata"=>{"format"=>"disabled"}}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"string", "index"=>"analyzed", "omit_norms"=>true, "fielddata"=>{"format"=>"disabled"}, "fields"=>{"raw"=>{"type"=>"string", "index"=>"not_analyzed", "ignore_above"=>256}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date"}, "@version"=>{"type"=>"string", "index"=>"not_analyzed"}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"float"}, "longitude"=>{"type"=>"float"}}}}}}}, :level=>:info}
slocalhost: Name or service not known {:class=>"Manticore::ResolutionFailure", :level=>:error}
New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["slocalhost"], :level=>:info}
Starting pipeline {:id=>"main", :pipeline_workers=>8, :batch_size=>125, :batch_delay=>5, :max_inflight=>1000, :level=>:info}
I have no idea what's wrong with the file. Please help. Thanks sincerely.