Logstash JMX input plugin cannot load Cassandra configuration

I am trying to get Cassandra metrics through logstash jmx input. My logstash pipeline conf:

/etc/logstash/conf.d/cassandra_jmx.conf
input {
   jmx {
      path => "/etc/logstash/jmxconf"
      polling_frequency => 15
      type => "jmx"
      nb_thread => 4
   }
}

output {
 elasticsearch {
        hosts => ["<elastic_ip>:9200"]
        user  => "myuser"
        password => "mypass"
        }
}

/etc/logstash/jmxconf/jmx_config.json :

{
      "host" : "my-cassandra-node",
      "port" : 7199,
      "username" : "my_jmx_user",
      "password": "my_jmx_pass",
      "alias" : "test.homeserver.elasticsearch",
"queries" : [{
     "object_name" : "org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=RequestResponseStage,name=*",
     "object_alias" : "${type}.${path}.${scope}.${name}"
}, {
    "object_name" : "java.lang:type=Threading",
    "object_alias" : "Threading"
  }, {
    "object_name" : "java.lang:type=Runtime",
    "attributes" : [ "Uptime", "StartTime" ],
    "object_alias" : "Runtime"
  }]
}

Logstash logs:

[2021-11-16T10:21:44,964][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:21:59,974][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:22:14,984][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:22:30,000][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:22:45,012][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:23:00,026][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:23:15,037][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:23:30,077][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:23:45,087][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:24:00,099][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:24:15,109][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:24:30,119][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:24:45,135][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:25:00,149][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:25:15,160][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:25:30,172][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:25:45,184][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:26:00,196][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}
[2021-11-16T10:26:15,205][INFO ][logstash.inputs.jmx      ][main][70c0319670d071bebf194cd4cefe30e2af3a41403e29630d54efa022132d965f] Loading configuration files in path {:path=>"/etc/logstash/jmxconf"}

What is your question?

The question is why this info logs continue indefinitely?

The main run function sits in a loop loading the configuration, logging this message, and calling thread_jmx. The thread_jmx function also loops. If you enable log.level debug it should be a lot easier to determine what path the code is taking.

I think you can use Jolokia to extract the metrics of Cassandra to the Rest API and run the metricbeat agent with enable jolokia module.

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