# JDBC input...how to capture query duration in metadata

**URL:** <https://discuss.elastic.co/t/jdbc-input-how-to-capture-query-duration-in-metadata/156208>\
**Category:** Logstash\
**Created:** [November 11, 2018, 4:11pm UTC](https://discuss.elastic.co/t/jdbc-input-how-to-capture-query-duration-in-metadata/156208 "2018-11-11T16:11:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Lyons](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_lyons/32/48107_2.png) [@Chris\_Lyons](https://discuss.elastic.co/u/Chris_Lyons)\
**Post date:** [November 11, 2018, 4:11pm UTC](https://discuss.elastic.co/t/jdbc-input-how-to-capture-query-duration-in-metadata/156208/1 "2018-11-11T16:11:33Z")

</div>

After the Logstash JDBC Input executes a query it writes out the duration seconds in the log file with the executed statement. Does anyone know where I can capture that value in the code and place it in a metadata field? I have tried to reverse engineer where it might be coming from but just cannot seem to pinpoint the source.

Thanks for the help!

---

<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:** [December 9, 2018, 4:11pm UTC](https://discuss.elastic.co/t/jdbc-input-how-to-capture-query-duration-in-metadata/156208/2 "2018-12-09T16:11:38Z")

</div>

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