# Measure time elapsed between apache entering request and tomcat exiting request

**URL:** <https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748>\
**Category:** Logstash\
**Created:** [December 5, 2019, 4:43pm UTC](https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748 "2019-12-05T16:43:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otmane\_Faouzi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otmane_faouzi/32/54905_2.png) [@Otmane\_Faouzi](https://discuss.elastic.co/u/Otmane_Faouzi)\
**Post date:** [December 5, 2019, 4:43pm UTC](https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748/1 "2019-12-05T16:43:36Z")

</div>

Hi,

We have developed some sort of proxy for a client's need. Incoming requests are processed and send it to the final destination.  
We need to measure the transit time between us, which is concretely the time between the arrival log on our Apache and the tomcat log (juste before we send it to the destination).  
These logs are on two separate files (apache httpd log and tomcat log). The target log lines have a common identifier.

Example:  
Apache Journal

185.113.39.55 - - [02/Dec/2019:15:29:09 +0000] "POST /myapplication HTTP/1.1" 200 266 **aa137784-e33d-4474-ae1b-0b879779ca85** 101284

Log tomcat:

2019-12-02T15: 29: 09.087Z, [http-nio-8080-exec-2], **aa137784-e33d-4474-ae1b-0b879779ca85** , **OUTBOUND request sent**

Regards,

---

<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:** [December 5, 2019, 5:22pm UTC](https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748/2 "2019-12-05T17:22:46Z")

</div>

You could do that using an [aggregate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html) filter.

---

<div class="post-metadata">

**Author:** ![Otmane\_Faouzi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otmane_faouzi/32/54905_2.png) [@Otmane\_Faouzi](https://discuss.elastic.co/u/Otmane_Faouzi)\
**Post date:** [December 6, 2019, 8:42am UTC](https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748/3 "2019-12-06T08:42:33Z")

</div>

Do I have to build one index or two for this need ?

---

<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:** [December 6, 2019, 1:26pm UTC](https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748/4 "2019-12-06T13:26:28Z")

</div>

You would only need one index.

---

<div class="post-metadata">

**Author:** ![Otmane\_Faouzi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otmane_faouzi/32/54905_2.png) [@Otmane\_Faouzi](https://discuss.elastic.co/u/Otmane_Faouzi)\
**Post date:** [December 6, 2019, 1:34pm UTC](https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748/5 "2019-12-06T13:34:17Z")

</div>

I found this on stackoverflow, which is not far from my need.

> <https://stackoverflow.com/questions/37353365/calculating-time-between-events>

Thanks.

---

<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:** [January 3, 2020, 1:34pm UTC](https://discuss.elastic.co/t/measure-time-elapsed-between-apache-entering-request-and-tomcat-exiting-request/210748/6 "2020-01-03T13:34:26Z")

</div>

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