All Apps and Add-ons

Can i connect to new JMX connections via SPL?



I have a situation where i need to connect to a dynamic list of URL and retrieve JMX data (I think if i could do this via SPL this would be the best, but open for suggestions!).

I have a new source-type JMX_DYNAMIC and i would like to use this source-type dynamically to view data via SPL. (Example below)

LAUNCHERHIBERNATE - service:jmx:rmi://
 LAUNCHER_WAREHOUSE - service:jmx:rmi://

The idea would be the list can keep been produced and change and i would like to keep retrieving data via JMX on the new ports as they arive into the system.

At the moment with the "splunk add on for Java management extension" this has to be done static.

for example /dell425srv2/apps/splunk_old_versions/splunk_7_0_3/splunk/etc/apps/Splunk_TA_jmx/local

description = MUREX
disabled = 0
index = jmx
interval = 20
servers = Splunk_TA_jmx:TEST2 | Splunk_TA_jmx:TRADE_INSERTION
sourcetype = jmx
templates = Splunk_TA_jmx:MUREX

This would also need jmx_servers.conf
description = TEST2
has_account = 1
interval = 60
jmx_url = service:jmx:rmi://mx12673vm:9092/jndi/rmi://mx12673vm:9092/jmxrmi

description = TRADE_INSERTION
has_account = 1
interval = 5
jmx_url = service:jmx:rmi://hp656srv:26827/jndi/rmi://hp656srv:26827/jmxrmi

What i need is to add multiple jmx_url onto the jmx_server.conf and create an increased line in servers = Splunk_TA_jmx:TEST2 | Splunk_TA_jmx:TRADE_INSERTION + X + Y etc...

So I have two options

  • 1st Add to .conf files dynamically 2nd Run a JMX command via SPL -

I am open to suggestions 🙂

Thanks in Advance
Robert Lynch

0 Karma



If you want to collect data from jmx Urls defined in the specific file then you have to configure dynamic JMX URL in jmx_servers.conf and jmx_tasks.conf.

In jmx_servers.conf you have to add all JMX URLs from your file. One JMX URL entry , one server stanza with URL in jmx_servers.conf. Make server stanza name sequential like, TEST_1,TEST_2,TEST_3,.....,TEST_n. So this names can be easily used in jmx_task.conf as you mentioned in the question.

To make this changes dynamically, you have to write a script which can read JMX URLs and customize appropriate changes in jmx_servers.conf and 'jmx_tasks.conf`. This script should be executed when JMX URLs file is changed. Means whenever JMX URLs file changed at that moment jmx configuration files will be changed.

If we talk about data collection, Splunk Add-on for JMX is using default modular input. This modular input is written in such a way where any changes detected in any configurations all the server, task and template configurations will be reloaded and data collection will start with new configurations. There is no need to do any extra handing or execution of SPL for data collection.

So you can go with this approach.


0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...