# Metricbeat Jolokia Module Not Publishing Custom MBean Data

**URL:** <https://discuss.elastic.co/t/metricbeat-jolokia-module-not-publishing-custom-mbean-data/238337>\
**Category:** Beats\
**Tags:** beats-module, metricbeat\
**Created:** [June 23, 2020, 8:17pm UTC](https://discuss.elastic.co/t/metricbeat-jolokia-module-not-publishing-custom-mbean-data/238337 "2020-06-23T20:17:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronjonsilver](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@ronjonsilver](https://discuss.elastic.co/u/ronjonsilver)\
**Post date:** [June 23, 2020, 8:17pm UTC](https://discuss.elastic.co/t/metricbeat-jolokia-module-not-publishing-custom-mbean-data/238337/1 "2020-06-23T20:17:45Z")

</div>

Hello,

I have been trying to get a field from a custom bean published to Kibana but it seems like jolokia is ignoring the jmx mapping for the custom bean field.

Here is my metricbeat.yml:

```auto
    metricbeat.modules:
      - module: jolokia
    metricsets: ["jmx"]
    enabled: true
    period: 10s
    hosts: ["https://localhost:8993"]
    path: "/admin/jolokia"
    ssl.verification_mode: none
    namespace: "testnamespace"
    http_method: "GET" 
    jmx.mappings:
      - mbean: 'App Status:service=Health'
        attributes:
          - attr: CurrentStatus
            field: health
      - mbean: 'java.lang:type=Runtime'
        attributes:
          - attr: Uptime
            field: uptime

```

The field `jolokia.testnamespace.uptime` is visible with the correct data in kibana. Although `jolokia.testnamespace.health` field does not exist in kibana. Metricbeat debug logs do not report any error.

```auto
    metricbeat | 2020-06-23T20:07:47.133Z	DEBUG	[jolokia.jmx]	jmx/config.go:366	Jolokia response body	{"host": "localhost:8993", "host": "localhost:8993", "uri": "https://localhost:8993/admin/jolokia/read/java.lang:type=Runtime/Uptime?ignoreErrors=true&canonicalNaming=false", "body": "{\"request\":{\"mbean\":\"java.lang:type=Runtime\",\"attribute\":\"Uptime\",\"type\":\"read\"},\"value\":5808306,\"timestamp\":1592942867,\"status\":200}", "type": "response"}

    metricbeat | 2020-06-23T20:09:54.652Z	DEBUG	[jolokia.jmx]	jmx/config.go:366	Jolokia response body	{"host": "localhost:8993", "host": "localhost:8993", "uri": "https://localhost:8993/admin/jolokia/read/App Status:service=Health/CurrentStatus?ignoreErrors=true&canonicalNaming=false", "body": "{\"request\":{\"mbean\":\"App Status:service=Health\",\"attribute\":\"CurrentStatus\",\"type\":\"read\"},\"value\":\"Good\",\"timestamp\":1592942994,\"status\":200}", "type": "response"}

```

Although, the publish only publishes `uptime` field and not `health` as stated before.

```auto
    "@timestamp": "2020-06-23T20:09:57.949Z",
      "@metadata": {
        "beat": "metricbeat",
        "type": "_doc",
        "version": "7.5.1"
      },
      "agent": {
        "ephemeral_id": "f373d7d4-...",
        "hostname": "9962...",
        "id": "cbab3a1e-...",
        "version": "7.5.1",
        "type": "metricbeat"
      },
      "event": {
        "module": "jolokia",
        "duration": 10799099116,
        "dataset": "jolokia.testnamespace"
      },
      "metricset": {
        "period": 10000,
        "name": "jmx"
      },
      "jolokia": {
        "testnamespace": {
          "uptime": 5.949921e+06
        }
      },
      "service": {
        "address": "localhost:8993",
        "type": "jolokia"
      },
      "ecs": {
        "version": "1.1.0"
      },
      "host": {
        "name": "99624a..."
      }
    }

```

Any help is appreciate.  
Thanks!

---

<div class="post-metadata">

**Author:** ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)\
**Post date:** [June 24, 2020, 6:04am UTC](https://discuss.elastic.co/t/metricbeat-jolokia-module-not-publishing-custom-mbean-data/238337/2 "2020-06-24T06:04:58Z")

</div>

Could you dump here what do you see if you hit the URL `https://localhost:8993/admin/jolokia/read/App Status:service=Health/CurrentStatus?ignoreErrors=true&canonicalNaming=false` ?

---

<div class="post-metadata">

**Author:** ![ronjonsilver](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@ronjonsilver](https://discuss.elastic.co/u/ronjonsilver)\
**Post date:** [June 24, 2020, 4:47pm UTC](https://discuss.elastic.co/t/metricbeat-jolokia-module-not-publishing-custom-mbean-data/238337/3 "2020-06-24T16:47:55Z")

</div>

Sure thing!

Here it is:

```auto
{
    "request": {
       "mbean": "App Status:service=Health",
       "attribute": "CurrentStatus",
       "type": "read"
    },
    "value": "Good",
    "timestamp": 1593017229,
    "status": 200
}

```

---

<div class="post-metadata">

**Author:** ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)\
**Post date:** [June 25, 2020, 7:44am UTC](https://discuss.elastic.co/t/metricbeat-jolokia-module-not-publishing-custom-mbean-data/238337/4 "2020-06-25T07:44:47Z")

</div>

I think you can create an issue for this in Beats. The configuration doesn't look bad, I wonder if the metricbeat swallows an error somewhere.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 23, 2020, 9:45am UTC](https://discuss.elastic.co/t/metricbeat-jolokia-module-not-publishing-custom-mbean-data/238337/5 "2020-07-23T09:45:05Z")

</div>

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