# Can I aggregate field values into rate?

**URL:** <https://discuss.elastic.co/t/can-i-aggregate-field-values-into-rate/45454>\
**Category:** Kibana\
**Created:** [March 25, 2016, 3:01pm UTC](https://discuss.elastic.co/t/can-i-aggregate-field-values-into-rate/45454 "2016-03-25T15:01:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![moryaden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moryaden/32/135648_2.png) [@moryaden](https://discuss.elastic.co/u/moryaden)\
**Post date:** [March 25, 2016, 3:01pm UTC](https://discuss.elastic.co/t/can-i-aggregate-field-values-into-rate/45454/1 "2016-03-25T15:01:03Z")

</div>

I have a field with values recorded in bits, like

moduleA = 0x01  
moduleB = 0x02

and one document would be recorded with values like:  
{name:john, flowflag:1} msg run into module a  
{name:foo, flowflag:2} msg run into module b  
{name:bar, flowflag:3} msg run into module a&b

the question is,  
how could I get a rate  
msgs into A/msgs into B --\> 95% ?

Thanks a lot...

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [March 25, 2016, 5:54pm UTC](https://discuss.elastic.co/t/can-i-aggregate-field-values-into-rate/45454/2 "2016-03-25T17:54:00Z")

</div>

If I'm understanding correctly, you'd like to take the number of documents which have `{flowflag: 1}` or `{flowflag: 3}` and divide it by the number of documents which have `{flowflag: 2}` or `{flowflag: 3}`, and create something like a metric visualization with the result. Is that correct?

Unfortunately, I can't think of a way something like this can be accomplished inside Kibana today, and perhaps not until there is some implementation of [pipeline aggregations](https://github.com/elastic/kibana/issues/4584) inside Kibana. The best you could probably do is to create two separate metric visualizations, each with the sum of the documents with the corresponding `flowflag` value, but you'd have to manually do the rate calculation. :-\

---

<div class="post-metadata">

**Author:** ![moryaden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moryaden/32/135648_2.png) [@moryaden](https://discuss.elastic.co/u/moryaden)\
**Post date:** [March 26, 2016, 3:17am UTC](https://discuss.elastic.co/t/can-i-aggregate-field-values-into-rate/45454/3 "2016-03-26T03:17:33Z")

</div>

Yes, I would like to get visualization for  
{flowflag:1} / ({flowflag:1} + {flowflag:2})

That is bad news, I think I have to manually calculate them myself.  
Thanks a lot..

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [March 28, 2016, 3:49pm UTC](https://discuss.elastic.co/t/can-i-aggregate-field-values-into-rate/45454/4 "2016-03-28T15:49:51Z")

</div>

I think Timelion plugin for Kibana can do things like this? I'm not very experienced with it yet.

---

<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 6, 2017, 1:57pm UTC](https://discuss.elastic.co/t/can-i-aggregate-field-values-into-rate/45454/5 "2017-07-06T13:57:40Z")

</div>

Closed on July 6, 2017, 1:57pm UTC


