# How to format number in logstash?

**URL:** <https://discuss.elastic.co/t/how-to-format-number-in-logstash/267182>\
**Category:** Logstash\
**Created:** [March 14, 2021, 12:03pm UTC](https://discuss.elastic.co/t/how-to-format-number-in-logstash/267182 "2021-03-14T12:03:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![padamrai](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@padamrai](https://discuss.elastic.co/u/padamrai)\
**Post date:** [March 14, 2021, 12:03pm UTC](https://discuss.elastic.co/t/how-to-format-number-in-logstash/267182/1 "2021-03-14T12:03:49Z")

</div>

Suppose I want to sum field its sum range 1 to 10000 then shows like 10k,  
sum range from 10000 to million it shows in million  
and sum range more than millions then it shows in billions.  
Is it possible to perform such a filter to get above results.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 14, 2021, 2:59pm UTC](https://discuss.elastic.co/t/how-to-format-number-in-logstash/267182/2 "2021-03-14T14:59:29Z")

</div>

You could re-purpose some of the Ruby on Rails [code](https://github.com/rails/rails/blob/005e14b2c4c403c7a85902f00d58c32bfc9ecd6c/activesupport/lib/active_support/number_helper/number_to_human_converter.rb) for number\_to\_human.

---

<div class="post-metadata">

**Author:** ![padamrai](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@padamrai](https://discuss.elastic.co/u/padamrai)\
**Post date:** [March 15, 2021, 5:14am UTC](https://discuss.elastic.co/t/how-to-format-number-in-logstash/267182/3 "2021-03-15T05:14:55Z")

</div>

Sir Thanks for your response but I am not getting this, any plugin in Logstash to fulfilled above requirement without using RUBY?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 15, 2021, 2:21pm UTC](https://discuss.elastic.co/t/how-to-format-number-in-logstash/267182/4 "2021-03-15T14:21:30Z")

</div>

> [@padamrai](#):
>
> any plugin in Logstash to fulfilled above requirement without using RUBY?

No, there is not.

---

<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:** [April 12, 2021, 2:21pm UTC](https://discuss.elastic.co/t/how-to-format-number-in-logstash/267182/5 "2021-04-12T14:21:43Z")

</div>

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