# How to add the count of 2 values in logstash

**URL:** <https://discuss.elastic.co/t/how-to-add-the-count-of-2-values-in-logstash/238077>\
**Category:** Logstash\
**Created:** [June 22, 2020, 11:43am UTC](https://discuss.elastic.co/t/how-to-add-the-count-of-2-values-in-logstash/238077 "2020-06-22T11:43:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matish\_Bhuyan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matish_bhuyan/32/68043_2.png) [@Matish\_Bhuyan](https://discuss.elastic.co/u/Matish_Bhuyan)\
**Post date:** [June 22, 2020, 11:43am UTC](https://discuss.elastic.co/t/how-to-add-the-count-of-2-values-in-logstash/238077/1 "2020-06-22T11:43:56Z")

</div>

Hi All,

I have a requirement in logstash.

For an example in fruits keyword i have 3 values

1- Mangoes ---- 5  
2- Oranges -----6  
3- Brinjal -----7

But in Kibana i need to visualize the sum of only 2 objects as shown below,But without using the inbuilt count plugin available in Kibana.

Fruits count  
Mangoes 5  
Oranges 6  
Brinjal 7  
Total no of fruits are 11

What is the filter code i need to write in the Logstash.conf file in order to achieve this.

Note i am using elk version 7.2 and all the values are coming from the same keyword.value

---

<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 20, 2020, 11:43am UTC](https://discuss.elastic.co/t/how-to-add-the-count-of-2-values-in-logstash/238077/2 "2020-07-20T11:43:57Z")

</div>

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