# Kibana sum by max metricbeat kafka module

**URL:** <https://discuss.elastic.co/t/kibana-sum-by-max-metricbeat-kafka-module/157060>\
**Category:** Kibana\
**Created:** [November 16, 2018, 1:18pm UTC](https://discuss.elastic.co/t/kibana-sum-by-max-metricbeat-kafka-module/157060 "2018-11-16T13:18:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandip4evr](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Sandip4evr](https://discuss.elastic.co/u/Sandip4evr)\
**Post date:** [November 16, 2018, 1:18pm UTC](https://discuss.elastic.co/t/kibana-sum-by-max-metricbeat-kafka-module/157060/1 "2018-11-16T13:18:57Z")

</div>

hi team,  
I have been working with metricbeat module and trying to get SUM (offset.newest)of topic by getting max from each partition. Seems like i just cannot get right SUM. here is the structure 🙂

```auto
"kafka": {
    "partition": {
      "broker": {
        "id": 1,
        "address": "localhost:9092"
      },
      "partition": {
        "replica": 1,
        "insync_replica": true,
        "id": 2,
        "leader": 1
      },
      "offset": {
        "newest": 2380344,
        "oldest": 0
      },
      "topic": {
        "name": "ABC.20181115"
      }
    }
  }

```

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [November 16, 2018, 5:44pm UTC](https://discuss.elastic.co/t/kibana-sum-by-max-metricbeat-kafka-module/157060/2 "2018-11-16T17:44:36Z")

</div>

Hi,  
We need to know your fields/mapping in discover. May be use a scripted field ?[https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

Thanks  
Rashmi

---

<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:** [December 14, 2018, 5:44pm UTC](https://discuss.elastic.co/t/kibana-sum-by-max-metricbeat-kafka-module/157060/3 "2018-12-14T17:44:40Z")

</div>

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