# Visualize transaction duration

**URL:** <https://discuss.elastic.co/t/visualize-transaction-duration/86857>\
**Category:** Kibana\
**Created:** [May 23, 2017, 6:49pm UTC](https://discuss.elastic.co/t/visualize-transaction-duration/86857 "2017-05-23T18:49:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_Stephens](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@Bill\_Stephens](https://discuss.elastic.co/u/Bill_Stephens)\
**Post date:** [May 23, 2017, 6:49pm UTC](https://discuss.elastic.co/t/visualize-transaction-duration/86857/1 "2017-05-23T18:49:32Z")

</div>

I'm logging transaction steps in to logstash. Steps can be logged from multiple hosts depending on the function. Each of the steps can be tied together with a transaction id. How do I calculate the entire transaction duration and chart the average transaction duration over time? If all the steps were coming from a single host, I realize I could use logstash's elapsed function, but since the steps can come from multiple hosts, I can't tie them together that way.

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [May 23, 2017, 11:40pm UTC](https://discuss.elastic.co/t/visualize-transaction-duration/86857/2 "2017-05-23T23:40:28Z")

</div>

Hi Bill,

I had no clue on how to help you. So I got help from the Kibana viz team.  
Unfortunately, this isn't possible in any of the available visualizations in the Kibana UI.

You can compute the min and max time using a sibling-aggregation (min/max) on that transactionId. So, you will have to write a sibling aggregation script in ES which does this.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html)

But as I mentioned before Kibana UI can't do this.

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 24, 2017, 8:05am UTC](https://discuss.elastic.co/t/visualize-transaction-duration/86857/3 "2017-05-24T08:05:47Z")

</div>

As documents can come from different sources, I suspect the best way to tackle this would be by creating an [entity-centric index](https://www.elastic.co/elasticon/2015/sf/building-entity-centric-indexes) for the transactions and periodically retrieve all newly inserted documents and update these. If dine through a periodic batch job it will not be real-time, but if you have large volumes of data this is often preferable compared to updating the entity-centric index on very insert, which is also a possibility.

---

<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:** [June 21, 2017, 8:06am UTC](https://discuss.elastic.co/t/visualize-transaction-duration/86857/4 "2017-06-21T08:06:22Z")

</div>

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