All Apps and Add-ons

JMX App: How to remove "key = " from the value of JMX attributes?

taxtgg
Engager

I am extracting JMX data from openDJ (LDAP by ForgeRock.com).
I tried:

and


In either case the fields show up in events like this:
ldapMessagesWritten="ldapMessagesWritten = 2035226"

The only clue I found was that there is no descriptor for the attributes (I am using JConsole)

Thanks.

Tags (2)

Damien_Dallimor
Ultra Champion

I will fire up a test instance of OpenDJ and have a look.
It seems that the actual MBean attribute value is being returned as "key=value" rather than just "value".
Splunk4JMX has an architecture that allows you to plug in custom Formatters which encapsulate the logic for the formatting of the event that gets Splunk'd.
It is pretty simple to write one.Have a look at the docs in the first instance, and if you need help creating one, I can certainly assist 🙂
The source code for current Formatters shipped with the product is also viewable on github.

A custom OpenDJJMXFormatter could simply have logic to strip the "key=" part from the JMX Attribute value.

Damien_Dallimor
Ultra Champion

Ok, come and get it , SPLUNK4JMX v1.5.3 released with above mentioned functionality !

0 Karma

Damien_Dallimor
Ultra Champion

Written some new code , just need to test it a bit more thoroughly before releasing.

So in your config.xml you'll be able to declare a pattern or list of patterns to strip content from the JMX attribute/operation values :

ie :




0 Karma

Damien_Dallimor
Ultra Champion

Actually , give me a day or so , I will release a new version of Splunk4JMX so you can pass a configuration parameter to the Formatter declaration in config.xml that allows you to declare a regex pattern, or list of regex patterns, that if matched, will strip the matched text from the returned JMX Attribute or Operation value. This is a more flexible and reusable approach than creating a custom formatter just for OpenDJ.

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

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 ...