The Jolokia documentation (https://jolokia.org/reference/html/protocol.html#paths) shows that is possibile to retrieve value from "An inner path points to a certain substructure (plain value, array, hash) within a a complex JSON value".
With a GET the sintax to read that value is:
<base-url>/read/<mbean name>/<attribute name>/<inner path>
With a POST the sintax to read that value is:
<base-url> { "attribute": "<attribute name>", "mbean": "<mbean name>", "path": "<inner path>", "type": "read" }
In WebSphere AS I put this JVM custom property:
name: jvm.name
value: <jvm_name>
So if I call jolokia with :
curl "http://localhost:9999/jolokia/read/java.lang:type=Runtime/SystemProperties/jvm.name"
or:
curl -d '{"type":"read","mbean":"java.lang:type=Runtime","attribute":"SystemProperties","path":"jvm.name"}' -H "Content-Type: application/json" -X POST "http://localhost:9999/jolokia"
I obtain:
{"request":{"path":"jvm.name","mbean":"java.lang:type=Runtime","attribute":"SystemProperties","type":"read"},"value":"<jvm_name>","timestamp":<timestamp>,"status":200}
But if in jolokia.yml I write:
- module: jolokia
metricsets: ["jmx"]
enabled: true
hosts: ["localhost:9999/jolokia/"]
namespace: "metrics"
http_method: "POST"
jmx.mappings:
- mbean: 'java.lang:type=Runtime'
attributes:
- attr: SystemProperties
path: jvm.name
field: jvm.name
I obtain the error:
elasticsearch/client.go:535 Cannot index event publisher
And if in jolokia.yml I write:
[...]
- mbean: 'java.lang:type=Runtime'
attributes:
- attr: 'SystemProperties/jvm.name'
field: jvm.name
I obtain the error:
ERROR: No such attribute: SystemProperties/jvm.name (class javax.management.AttributeNotFoundException)
The same error appear if I write:
mbean: 'java.lang:type=Runtime/SystemProperties'
or:
- attr: 'SystemProperties:jvm.name'
Which is the correct way to get value from inner path?
Thanks a lot