# Datetime named parameter in jdbc input

**URL:** <https://discuss.elastic.co/t/datetime-named-parameter-in-jdbc-input/91012>\
**Category:** Logstash\
**Created:** [June 27, 2017, 6:22pm UTC](https://discuss.elastic.co/t/datetime-named-parameter-in-jdbc-input/91012 "2017-06-27T18:22:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zahodi](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@zahodi](https://discuss.elastic.co/u/zahodi)\
**Post date:** [June 27, 2017, 6:22pm UTC](https://discuss.elastic.co/t/datetime-named-parameter-in-jdbc-input/91012/1 "2017-06-27T18:22:39Z")

</div>

How do I pass a datetime as a named parameter in logstash jdbc input? Trying to query mysql based on the current date and time.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 27, 2017, 6:30pm UTC](https://discuss.elastic.co/t/datetime-named-parameter-in-jdbc-input/91012/2 "2017-06-27T18:30:00Z")

</div>

Why would you have to used a named parameter to make a query based on the current date and time? MySQL has functions for that.

---

<div class="post-metadata">

**Author:** ![zahodi](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@zahodi](https://discuss.elastic.co/u/zahodi)\
**Post date:** [June 27, 2017, 8:28pm UTC](https://discuss.elastic.co/t/datetime-named-parameter-in-jdbc-input/91012/3 "2017-06-27T20:28:10Z")

</div>

Everyday I need to grab mysql data from the previous day.

---

<div class="post-metadata">

**Author:** ![zahodi](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@zahodi](https://discuss.elastic.co/u/zahodi)\
**Post date:** [June 27, 2017, 8:44pm UTC](https://discuss.elastic.co/t/datetime-named-parameter-in-jdbc-input/91012/4 "2017-06-27T20:44:58Z")

</div>

You are right, I didn't realize I can do it through mysql.

---

<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 25, 2017, 8:45pm UTC](https://discuss.elastic.co/t/datetime-named-parameter-in-jdbc-input/91012/5 "2017-07-25T20:45:00Z")

</div>

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