# Display graph to show the average time spent in a camel route

**URL:** <https://discuss.elastic.co/t/display-graph-to-show-the-average-time-spent-in-a-camel-route/74500>\
**Category:** Kibana\
**Created:** [February 9, 2017, 12:58pm UTC](https://discuss.elastic.co/t/display-graph-to-show-the-average-time-spent-in-a-camel-route/74500 "2017-02-09T12:58:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbData](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@pbData](https://discuss.elastic.co/u/pbData)\
**Post date:** [February 9, 2017, 12:58pm UTC](https://discuss.elastic.co/t/display-graph-to-show-the-average-time-spent-in-a-camel-route/74500/1 "2017-02-09T12:58:33Z")

</div>

Hi,  
Currently I am taking logs from a camel application. When we go through a camel route there are several logging statements. Each time we go through that route a breadcrumId(unique identifier) is created and is logged in each of the logging statements. Each log has a time associated with it. I would like to work out the time difference between start and end of the camel route, via the timestamp. Then from this I would like to be able to show a line graph that simply shows the average of these for a time bin.

---

<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:** [February 9, 2017, 6:41pm UTC](https://discuss.elastic.co/t/display-graph-to-show-the-average-time-spent-in-a-camel-route/74500/2 "2017-02-09T18:41:16Z")

</div>

Hi Paul,

This is not something very easy to do with Kibana. I think you would have to write some JSON scripting. See this thread for an example;

> [@Display concurrency in data on Kibana](https://discuss.elastic.co/t/display-concurrency-in-data-on-kibana/26006/12):
>
> I also tried this but it doesn't remove the field parameter as promised. With the following json input: { "interval":"minute", "script": "start = doc['recordStart'].value; duration = doc['recordDuration'].value; l = []; for (long i = 0; i \< duration; i += 60000) { l.add(start + i); }; return l;", "field":null, "lang": "groovy" } I get the following request "aggs": { "2": { "date\_histogram": { "field": null, "interval": "minute", "pre\_zone": "+02:00", "pre\_zone\_adjust\_large…

---

<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:** [March 9, 2017, 6:41pm UTC](https://discuss.elastic.co/t/display-graph-to-show-the-average-time-spent-in-a-camel-route/74500/3 "2017-03-09T18:41:28Z")

</div>

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