# How to graphic a Division between two selected metrics

**URL:** <https://discuss.elastic.co/t/how-to-graphic-a-division-between-two-selected-metrics/235216>\
**Category:** Kibana\
**Created:** [June 1, 2020, 6:37pm UTC](https://discuss.elastic.co/t/how-to-graphic-a-division-between-two-selected-metrics/235216 "2020-06-01T18:37:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fchantada](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@fchantada](https://discuss.elastic.co/u/fchantada)\
**Post date:** [June 1, 2020, 6:37pm UTC](https://discuss.elastic.co/t/how-to-graphic-a-division-between-two-selected-metrics/235216/1 "2020-06-01T18:37:03Z")

</div>

Hi,

Starting from MetricBeats metrics with the ElasticSearch Module. I want to graphic on Kibana the Search Latency. I know that the necessary metrics are node\_stats.indices.search.query\_time\_in\_millis and node\_stats.indices.search.query\_total, but because both are cumulative, I have to apply the Derivate of each one.  
Once this is calculated, I have to do the division between them for obtaining the Latency, but I don't know how to do this on Kibana.

Is this possible or am I trying to do something impossible?

Metrics:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/e/0ee70bc5db7a370daacc72d2d2b2afb83aaf72d6.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/b/dbb45aa0b73554446c43f353a8eb1db783570de5.png)

Buckets:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/5/c5e6a4d59bdd4708d53ab1c39fca571ff1b44ae0.png)

Current Graphics: (with both metrics separately)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/0/6009604cce2e157fd05569db932358d408129103.png)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [June 4, 2020, 8:03am UTC](https://discuss.elastic.co/t/how-to-graphic-a-division-between-two-selected-metrics/235216/2 "2020-06-04T08:03:21Z")

</div>

Hi @fchantada  
unfortunately it's not possible to do that using the Visualize line chart, but you can do that with TSVB that allows you to apply the derivative and any other Math between series.  
Please also check this link that maybe useful [https://www.elastic.co/blog/visualizing-observability-with-kibana-event-rates-and-rate-of-change-in-tsvb](https://www.elastic.co/blog/visualizing-observability-with-kibana-event-rates-and-rate-of-change-in-tsvb)

---

<div class="post-metadata">

**Author:** ![fchantada](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@fchantada](https://discuss.elastic.co/u/fchantada)\
**Post date:** [June 11, 2020, 11:53am UTC](https://discuss.elastic.co/t/how-to-graphic-a-division-between-two-selected-metrics/235216/3 "2020-06-11T11:53:14Z")

</div>

Hi @markov00 , thank you very much for your reply.  
Finally, I've resolved it using Timelion. I leave the example here:

> .es(index=".monitoring-es-7-mb\*",q=cluster\_uuid:xxx,  
> timefield='timestamp', metric='max:node\_stats.indices.search.query\_time\_in\_millis').derivative().divide(.es(index=".monitoring-es-7-mb\*",q=cluster\_uuid:xxx,  
> timefield='timestamp',  
> metric='max:node\_stats.indices.search.query\_total').derivative())  
> .legend(columns=1, position=s)  
> .label("Search")

---

<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 9, 2020, 11:53am UTC](https://discuss.elastic.co/t/how-to-graphic-a-division-between-two-selected-metrics/235216/4 "2020-07-09T11:53:18Z")

</div>

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