Trying to read Kafka JMX metrics data into Logstash, Here are the config-
$ cat jmx.conf
input {
jmx {
path => "/home/ubuntu/dev/logstash-6.2.4/conf"
polling_frequency => 10
type => "jmx"
nb_thread => 2
}
}
output {
stdout { codec => rubydebug }
}
$ cat /home/ubuntu/dev/logstash-6.2.4/conf/jmx_config.json
{
"host" : "kafka-hostname.com",
"port" : 9000,
"queries" : [
{
"object_name" : "java.lang:type=Memory",
"object_alias" : "Memory"
}
]
}
Error is -
[2018-06-13T09:55:23,893][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, if, ", ', } at line 2, column 1 (byte 9) after input {\n", :backtrace=>["/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:42:in compile_imperative'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:50:in
compile_graph'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:12:in block in compile_sources'", "org/jruby/RubyArray.java:2486:in
map'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:11:in compile_sources'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/pipeline.rb:51:in
initialize'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/pipeline.rb:169:in initialize'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/pipeline_action/create.rb:40:in
execute'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:315:in block in converge_state'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:141:in
with_pipelines'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:312:in block in converge_state'", "org/jruby/RubyArray.java:1734:in
each'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:299:in converge_state'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:166:in
block in converge_state_and_update'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:141:in with_pipelines'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:164:in
converge_state_and_update'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:90:in execute'", "/home/ubuntu/dev/logstash-6.2.4/logstash-core/lib/logstash/runner.rb:348:in
block in execute'", "/home/ubuntu/dev/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}
jmx host-port are accessible and jmx plugin is installed-
$ ./bin/logstash-plugin list | grep jmx
logstash-input-jmx