Configure JMX inputs for the Splunk Add-on for Kafka
To collect performance metrics from your Kafka clusters, configure an input using the Splunk Add-on for JMX on a dedicated heavy forwarder that also has the Splunk Add-on for Kafka installed. Input configuration using the Splunk Add-on for JMX is supported through Splunk Web.
Enable the JMX server
This input requires that a JMX server be installed and running on the machines hosting your Kafka clusters. If the JMX server is not already enabled, follow these steps to enable it.
- Add
export JMX_PORT=${JMX_PORT:-9999}
to$KAFKA_HOME/bin/kafka-server-start.sh
beforeexec $base_dir/kafka-run-class.sh
. - Run
$KAFKA_HOME/bin/kafka-server-stop.sh
- Run
$KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties
.
Input configuration
Use the Splunk Add-on for JMX in Splunk Web to configure a collection task to gather your performance metrics. For more information about configuring an input using the Splunk Add-on for JMX, see Configure inputs for the Splunk Add-on for JMX.
- Log into Splunk Web and access the Splunk Add-on for JMX.
- Click Add Server.
- Fill out the fields.
- Use Splunk_TA_kafka as the destination app.
- Select Use URL directly for the connection type. The JMX connection URL is typically in this format:
service:jmx:rmi:///jndi/rmi://<kafka_host_name>:9999/jmxrmi
.
- Click Create.
- Click Configurations > Tasks.
- Click Add Task.
- Fill out the fields.
- Use Splunk_TA_kafka as the destination app.
- On the Servers tab, select the server you configured in step 3.
- On the Templates tab, select one of the preconfigured Kafka templates.
- On the Settings tab, set the Source Type to match the Kafka template that you selected on the Templates tab.
Template Source type KafkaServerStats kafka:serverStats
KafkaClusterStats kafka:clusterStats
KafkaControllerStats kafka:controllerStats
KafkaNetworkStats kafka:networkStats
KafkaLogStats kafka:logStats
KafkaCommon kafka:common
- Click Create.
- Repeat steps 6 through 8 for each template and source type in the table.
- Validate that data is coming in by searching for
sourcetype=kafka:*Stats
and
sourcetype=kafka:common
Configure monitor inputs for the Splunk Add-on for Kafka | Configure modular inputs for the Splunk Add-on for Kafka |
This documentation applies to the following versions of Splunk® Supported Add-ons: released
Feedback submitted, thanks!