# V6.0.0-beta2 http module mapping trouble

**URL:** <https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [September 7, 2017, 9:40am UTC](https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703 "2017-09-07T09:40:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylvain\_Mougenot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_mougenot/32/4268_2.png) [@Sylvain\_Mougenot](https://discuss.elastic.co/u/Sylvain_Mougenot)\
**Post date:** [September 7, 2017, 9:40am UTC](https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703/1 "2017-09-07T09:40:08Z")

</div>

I'm trying to collect metrics from Dorpwizard metrics.  
Those are exposed by the REST API as Json.

I tryed dropwizard module for metrics but it seams not to fetch any datas.  
Then switched to http module for metrics but not event is indexed due to mapping error

`2017-09-07T11:33:09+02:00 WARN Can not index event (status=400): {"type":"illegal_argument_exception","reason":"mapper [http.metrics_http_me.classes] of different type, current_type [long], merged_type [ObjectMapper]"}`

The index was dropped and service restarted without any improvement.

Can someone help to fix this, please.

Metricbeat version is 6.0.0-beta2 installed using rpm package on centos 6 VM.  
config files are  
/etc/metricbeat/metricbeat.yml

```
# Ansible managed

metricbeat.config.modules:
  path: /appli/conf/beats/metric*.yml
  reload.enabled: true
  reload.period: 30s

env: none
fields_under_root: false
name: localhost

processors: null

output.elasticsearch.hosts:
- localhost:9200

logging:
  files:
    keepfiles: 7
    name: metricbeat.log
    path: /var/log/metricbeat
    rotateeverybytes: 10485760
  level: info
  to_files: true

```

/appli/conf/beats/metricHttpMeasurement.yml

```
- module: http
  metricsets: ['json']
  hosts: ['localhost:8086/ep-manage/metrics']
  period: 10s
  username: 'admin'
  password: 'password'
  namespace: 'metrics_http_me'
```

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [September 7, 2017, 9:55am UTC](https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703/2 "2017-09-07T09:55:08Z")

</div>

Hi @Sylvain_Mougenot,

I think that your endpoint is returning different values for `classes` field, and switching between a number (long) and a map (object). That is probably causing issues with automatic mapping, does this make sense?

On the other hand, did you try to debug your dropwizard issue?

---

<div class="post-metadata">

**Author:** ![Sylvain\_Mougenot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_mougenot/32/4268_2.png) [@Sylvain\_Mougenot](https://discuss.elastic.co/u/Sylvain_Mougenot)\
**Post date:** [September 7, 2017, 10:20am UTC](https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703/3 "2017-09-07T10:20:32Z")

</div>

About dropwizard, even in debug, I've not logs for this module.

You are right, the endpoint (standard spring-boot actuator) seems to expose jmx metrics that have a confusing naming convention

```
  "classes": 15946,
  "classes.loaded": 16303,
  "classes.unloaded": 357,
  "heap": 254976,
  "heap.committed": 238080,
  "heap.init": 131072,
  "heap.used": 142330,
  "mem": 395507,
  "mem.free": 95749,
  "nonheap": 1556480,
  "nonheap.committed": 161792,
  "nonheap.init": 2496,
  "nonheap.used": 157427,
  "threads": 67,
  "threads.daemon": 46,
  "threads.peak": 70,
  "threads.totalStarted": 8182,

```

Is there a way to filter those in metrics settings?  
I might be able to remove them from the spring-boot endpoint but it means to modify applications (I'd rather change one settings instead of redeploying all apps)

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [September 7, 2017, 10:35am UTC](https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703/4 "2017-09-07T10:35:40Z")

</div>

I think [drop\_fields](https://www.elastic.co/guide/en/beats/metricbeat/current/drop-fields.html) processor should work for you, just add it with `fields: ["classes"]`.

In any case it would be nice to debug your JMX issues if you are willing to, feel free to open a new thread for that.

---

<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:** [October 5, 2017, 10:35am UTC](https://discuss.elastic.co/t/v6-0-0-beta2-http-module-mapping-trouble/99703/5 "2017-10-05T10:35:41Z")

</div>

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